When the Messenger of Allah ﷺ intended to send Mu'adh ibn Jabal to the Yemen, he asked: How will you judge when the occasion of deciding a case arises? He replied: I shall judge in accordance with Allah's Book. He asked: (What will you do) if you do not find any guidance in Allah's Book? He replied: (I shall act) in accordance with the Sunnah of the Messenger of Allah ﷺ. He asked: (What will you do) if you do not find any guidance in the Sunnah of the Messenger of Allah ﷺ and in Allah's Book? He replied: I shall do my best to form an opinion and I shall spare no effort. The Messenger of Allah ﷺ then patted him on the breast and said: Praise be to Allah Who has helped the messenger of the Messenger of Allah to find something which pleases the Messenger of Allah. (Using translation from Abū Dāʾūd 3592)
عَنْ نَاسٍ مِنْ أَصْحَابِ مُعَاذٍ مِنْ أَهْلِ حِمْصٍ عَنْ مُعَاذٍ أَنَّ رَسُولَ اللهِ ﷺ حِينَ بَعَثَهُ إِلَى الْيَمَنِ فَقَالَ كَيْفَ تَصْنَعُ إِنْ عَرَضَ لَكَ قَضَاءٌ؟ قَالَ أَقْضِي بِمَا فِي كِتَابِ اللهِ قَالَ فَإِنْ لَمْ يَكُنْ فِي كِتَابِ اللهِ؟ قَالَ فَبِسُنَّةِ رَسُولِ اللهِ ﷺ قَالَ فَإِنْ لَمْ يَكُنْ فِي سُنَّةِ رَسُولِ اللهِ ﷺ؟ قَالَ أَجْتَهِدُ رَأْيِي لَا آلُو قَالَ فَضَرَبَ رَسُولُ اللهِ ﷺ صَدْرِي ثُمَّ قَالَ الْحَمْدُ لِلَّهِ الَّذِي وَفَّقَ رَسُولَ رَسُولِ اللهِ لِمَا يُرْضِي رَسُولَ اللهِ