كتاب صلاة المسافرين وقصرها
6  
The Book of Prayer - Travellers
(47)
Chapter: The virtue of one who acts in accordance with the Qur’an and teaches it. And the virtue of one who learns wisdom from Fiqh or other types of knowledge, then acts upon it and teaches it
(47)
باب فَضْلِ مَنْ يَقُومُ بِالْقُرْآنِ وَيُعَلِّمُهُ وَفَضْلِ مَنْ تَعَلَّمَ حِكْمَةً مِنْ فِقْهٍ أَوْ غَيْرِهِ فَعَمِلَ بِهَا وَعَلَّمَهَا
Sahih Muslim 816

'Abdullah b. Mas'ud reported Allah's Messenger (ﷺ) as saying:

There should be no envy but only in case of two persons: one having been endowed with wealth and power to spend it in the cause of Truth, and (the other) who has been endowed with wisdom and he decides cases with the help of it and teaches it (to others).
وَحَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا وَكِيعٌ، عَنْ إِسْمَاعِيلَ، عَنْ قَيْسٍ، قَالَ قَالَ عَبْدُ اللَّهِ بْنُ مَسْعُودٍ ح وَحَدَّثَنَا ابْنُ نُمَيْرٍ، حَدَّثَنَا أَبِي وَمُحَمَّدُ بْنُ بِشْرٍ، قَالاَ حَدَّثَنَا إِسْمَاعِيلُ، عَنْ قَيْسٍ، قَالَ سَمِعْتُ عَبْدَ اللَّهِ بْنَ مَسْعُودٍ، يَقُولُ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ لاَ حَسَدَ إِلاَّ فِي اثْنَتَيْنِ رَجُلٌ آتَاهُ اللَّهُ مَالاً فَسَلَّطَهُ عَلَى هَلَكَتِهِ فِي الْحَقِّ وَرَجُلٌ آتَاهُ اللَّهُ حِكْمَةً فَهُوَ يَقْضِي بِهَا وَيُعَلِّمُهَا ‏"‏ ‏.‏
Reference : Sahih Muslim 816
In-book reference : Book 6, Hadith 324
USC-MSA web (English) reference : Book 4, Hadith 1779
  (deprecated numbering scheme)