Allah's Messenger (ﷺ) said, "If anyone of you looked at a person who was made superior to him in property and (in good) appearance, then he should also look at the one who is inferior to him.
Sahih al-Bukhari Book 81, Hadith 79