How to recognize a pious Shaikh?

Shaikh Wasiullah Allahabadi (Allah have mercy on him) said,

‘The predecessor pious elders have documented that there are only two methods of recognizing a pious Shaikh.

The first is that the an individual is gifted by Allah with the ability of spiritual insight to do so.
The other method is that the individual is gifted by Allah with the ability to listen and accept the words of the knowledgeable and wise person.’

Halaat e Muslih al-Ummat ra, volume 3, page 323