Hazrat Moulana Ashraf Ali Thaanwi (rahimahullah) once mentioned the following:

The basis of one acquiring righteousness is having complete reliance on one’s shaikh, and thereafter adhering to his teachings. However, it is necessary for one to be careful and examine the level of Deen of the person one wishes to select as his shaikh to guide him in the path of Deen. Otherwise, through choosing the wrong person as one’s guide, one will end up treading on the path of misguidance.

(Malfoozaat Hakeemul Ummat 24/198)

Source: Ihyaauddeen.co.za