Sayyiduna Ali (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) sent me to Yemen. I said: "O Messenger of Allah (peace and blessings be upon him)! You are sending me as a judge, while I am young and have no knowledge of judging." He (peace and blessings be upon him) said: "O Ali! When two disputing parties come to you, listen to them, and do not judge until you have heard what the other says; the judgement will then become clear to you." He said: Then I continued judging in this way.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20486
Sayyiduna Ali (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) sent me to Yemen as a judge. I said: "O Messenger of Allah! I am young, and I have no knowledge of judging." He (peace and blessings be upon him) said: "Allah will soon guide your heart and keep your tongue firm. When you sit to judge, give judgement after hearing both of them. That is more likely to make the judgement clear to you." I always continued judging in this way, or: I had no doubt in judging (after that).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20487
Sayyiduna Ali (may Allah be pleased with him) said: When the Prophet (peace and blessings be upon him) sent me to Yemen, I said: "You (peace and blessings be upon him) are sending me as a judge, while I do not have much knowledge of judging." He (peace and blessings be upon him) said to me: "Judge after hearing what both disputing parties say. You will know how to judge. Allah will keep your tongue firm and guide your heart." Sayyiduna Ali (may Allah be pleased with him) said: After that I continued judging in this way.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20488