Sahih al-Bukhari, Book 93, Hadith 5 (Bukhari 6872)

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."