Sahih al-Bukhari 7141
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
لاَ حَسَدَ إِلاَّ فِي اثْنَتَيْنِ، رَجُلٌ آتَاهُ اللَّهُ مَالاً فَسَلَّطَهُ عَلَى هَلَكَتِهِ فِي الْحَقِّ، وَآخَرُ آتَاهُ اللَّهُ حِكْمَةً فَهْوَ يَقْضِي بِهَا وَيُعَلِّمُهَا "
Narrated `Abdullah:
Allah's Messenger (ﷺ) said, "Do not wish to be like anyone, except in two cases: (1) A man whom Allah has given wealth and he spends it righteously. (2) A man whom Allah has given wisdom (knowledge of the Qur'an and the Hadith) and he acts according to it and teaches it to others."
Full reference and source
Sahih al-Bukhari 7141 In-book : Book 93, Hadith 5 USC-MSA web (English) : Vol. 9, Book 89, Hadith 255 (deprecated)
View source on Sunnah.com (opens in a new tab)