Hazrat Moulana Ashraf Ali Thanwi (rahmatullahi ‘alaih) once mentioned:
If any person sees some good quality in himself and finds that quality lacking in another person, due to which he begins to regard himself to be better than that person, then he should immediately think to himself, “It is possible that this person does not have this good quality in him which I have, but he has some other praiseworthy quality in him which is lacking in me, due to which he is better than me in the sight of Allah Ta‘ala.”
Hazrat Thanwi (rahmatullahi ‘alaih) then mentioned, “If a person trains himself to think in this way, it will assist him to remove self-admiration and pride from his heart and it will save him from regarding himself to be better than others.” (Malfoozaat Hakeemul Ummat 23/55)
Source: Ihyaauddeen.co.za