Srimad Bhagavatam Canto 04, Chapter 08, Text 34

SB 4.8.34

gunadhikan mudam lipsed
anukrosam gunadhamat
maitrim samanad anvicchen
na tapair abhibhuyate
 
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
Every man should act like this: when he meets a person more qualified than himself, he should be very pleased; when he meets someone less qualified than himself, he should be compassionate toward him; and when he meets someone equal to himself, he should make friendship with him. In this way one is never affected by the threefold miseries of this material world.
 
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada:
 
Generally when we find someone more qualified than ourselves, we become envious of him; when we find someone less qualified, we deride him; and when we find someone equal we become very proud of our activities. These are the causes of all material tribulations. The great sage Narada therefore advised that a devotee should act perfectly. Instead of being envious of a more qualified man, one should be jolly to receive him. Instead of being oppressive to a less qualified man, one should be compassionate toward him just to raise him to the proper standard. And when one meets an equal, instead of being proud of one’s own activities before him, one should treat him as a friend. One should also have compassion for the people in general, who are suffering due to forgetfulness of Krsna. These important functions will make one happy within this material world.
Srimad Bhagavatam Canto 04, Chapter 08, Text 33
Srimad Bhagavatam Canto 04, Chapter 08, Text 35