Hazrat Ibn Mas‘ud, Allah be pleased with him, relates that the Holy Prophet, peace and blessings of Allah be upon him, said:
“Only two persons are worthy of being envied: a person upon whom Allah bestows riches and gives them the power to spend in a righteous cause; and a person upon whom Allah bestows wisdom by which they judge and which they teach.”
(Sahih al-Bukhari, Kitab al-‘Ilm)