Hazrat Moulana Ashraf Ali Thaanwi (rahimahullah) once mentioned the following:
The basis of one acquiring righteousness is having complete reliance on one’s sheikh, 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 sheikh 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)