Hazrat Shaikh Moulana Muhammad Zakariyya (rahmatullahi ‘alaih) once mentioned the following:
One easy remedy to remove the malady of self-admiration is that when one experiences feelings and thoughts of self-admiration, then one should immediately think of his sins. On thinking of his sins, he should express gratitude to Allah Ta‘ala for concealing his sins from the people. He should think to himself that had Allah Ta‘ala not kept his sins concealed from the people, then the reality of the matter is that on account of the abundant sins and weaknesses which he has, the people who are showing him respect will not even wish to spit on him (let alone associate with him).
(Qutbul Aqtaab Hazrat Sheikhul Hadith Moulana Muhammad Zakariyya (rahmatullahi ‘alaih) pg. 506)