[Taken from Imam Al-Ghazali's Ihya]
Know that Allah (SWT) shows to one for whom He wishes good his faults. Whoever has deep insight has no fear. When a man can know his faults, he can try to remove them. But the majority of men remain ignorant of their faults.
There are four ways to discover one's faults.
1. Disclose one's faults and evils to one's spiritual guide
The first is to disclose one's faults and evils to one's spiritual guide, who can treat his diseases. However, spiritual guides are very rare nowadays.
2. Appoint a true and pious friend to detect one's faults and defects
The second way is to appoint a true and pious friend to detect one's faults and defects. A religious man takes to this method of finding out his own defects and shortcomings.
'Umar prayed, "May Allah show mercy to the man who points out my defects to me." When he asked Salman about his faults, the latter told him, "I heard that you enjoy two curries when you eat and that you have two articles of clothes to put on-one for the day, and one for the night." 'Umar said, "Have you heard anything other than this?" Salman said, "I have heard nothing except this." Salman also once asked Hudhayfah whether he had found any hypocrisy in him.
Thus the Companions of the Prophet (s) inquired about their own faults.
When Dawud al-Ta'i, who remained aloof from society, was asked, "Why do you not mingle with people?" he replied, "What benefit shall I derive from them when they conceal my faults and do not inform me?"
Now, however, things have changed. Whoever informs us of our faults is our great enemy.
3. Gather them from enemies
The third way of knowing faults is to gather them from enemies. The attention of the enemies is on the faults of their adversaries. So there is some basis to their information about one's faults.
4. Mix with people and know their faults
The fourth way is to mix with people and know their faults.
If you see their faults, you may assume that you have those faults in you, as a believer is a mirror to another believer and sees his own defects in others. Isa (AS) was once asked, "From whom have you learnt good manners?" He replied, "Nobody has told me. When I saw the faults of the ignorant, I at once gave them up."