It was narrated from ‘Abdullah bin Mas’ud that the Messenger of Allah (ﷺ) said: “There is no (permissible) envy except in two cases: A man whom Allah has given wealth and caused him to dispose of it in a proper manner, and a man to whom Allah has given wisdom, and he acts in accordance with it and teaches it (to others).”
It was narrated from Salim that his father said: “The Messenger of Allah (ﷺ) said: ‘There is no envy except in two cases. A man to whom Allah has given (knowledge of) the Qur’an, so he recites it night and day, and a man to whom Allah has given wealth, so he spends it night and day.’”
It was narrated from Anas that the Messenger of Allah (ﷺ) said: “Envy consumes good deeds just as fire consumes wood, and charity extinguishes bad deeds just as water extinguishes fire. Prayer is the light of the believer and fasting is a shield against the Fire.”