عَنْ مُعَاذِ بْنِ جَبَلٍ أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ حِينَ بَعَثَهُ إِلَى الْيَمَنِ فَقَالَ: ((كَيْفَ تَصْنَعُ إِنْ عَرَضَ لَكَ قَضَاءٌ؟)) قَالَ: أَقْضِي بِمَا فِي كِتَابِ اللَّهِ، قَالَ: ((فَإِنْ لَمْ يَكُنْ فِي كِتَابِ اللَّهِ؟)) قَالَ: فَبِسُنَّةِ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ، قَالَ: ((فَإِنْ لَمْ يَكُنْ فِي سُنَّةِ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ؟)) قَالَ: أَجْتَهِدُ رَأْيِي، لَا آلُو، قَالَ: فَضَرَبَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ صَدْرِي ثُمَّ قَالَ: ((الْحَمْدُ لِلَّهِ الَّذِي وَفَّقَ رَسُولَ رَسُولِ اللَّهِ لِمَا يُرْضِي رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ))
It is narrated from Sayyiduna Mu'adh bin Jabal (may Allah be pleased with him) that when the Messenger of Allah (peace and blessings be upon him) sent him as a governor to Yemen, he (peace and blessings be upon him) asked: "When a case is presented before you, how will you decide?" He said: "I will decide according to the Book of Allah." The Prophet (peace and blessings be upon him) said: "If the matter is not found in the Book of Allah, then what?" He said: "Then I will decide in the light of the Sunnah of the Messenger of Allah." The Prophet (peace and blessings be upon him) said: "If you do not find it in the Sunnah of the Messenger of Allah either, then what?" He said: "Then I will exercise my own judgment (ijtihad) and I will not fall short in doing so." Upon hearing this, the Messenger of Allah (peace and blessings be upon him) patted the chest of Sayyiduna Mu'adh (may Allah be pleased with him) and said: "All praise is due to Allah, Who has granted the messenger of the Messenger of Allah the ability to do that which pleases the Messenger of Allah."