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