Sahih al-Bukhari 1409
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
لاَ حَسَدَ إِلاَّ فِي اثْنَتَيْنِ رَجُلٌ آتَاهُ اللَّهُ مَالاً فَسَلَّطَهُ عَلَى هَلَكَتِهِ فِي الْحَقِّ، وَرَجُلٌ آتَاهُ اللَّهُ حِكْمَةً فَهْوَ يَقْضِي بِهَا وَيُعَلِّمُهَا "
Narrated Ibn Mas`ud:
I heard the Prophet (ﷺ) saying, "There is no envy except in two: a person whom Allah has given wealth and he spends it in the right way, and a person whom Allah has given wisdom (i.e. religious knowledge) and he gives his decisions accordingly and teaches it to the others."
Full reference and source
Sahih al-Bukhari 1409 In-book : Book 24, Hadith 13 USC-MSA web (English) : Vol. 2, Book 24, Hadith 490 (deprecated)
View source on Sunnah.com (opens in a new tab)