Mu'adh b. Jabal told that when God’s Messenger sent him to the Yemen he asked him how he would judge when the occasion arose, and he replied that he would judge in accordance with God’s Book. He asked what he would do if he could not find guidance in God’s Book, and he replied that he would act in accordance with God’s Messenger’s sunnah. He asked what he would do if he could find no guidance in God’s Messenger’s sunnah, and he replied that he would do his best to form an opinion and spare no pains. God’s Messenger then tapped him on the breast and said, “Praise be to God who has disposed His Messenger’s Messenger to something with which God’s Messenger is pleased!"
Abu Huraira reported God’s Messenger as saying, “If anyone seeks the office of qadi among Muslims till he gets it and his justice prevails over his tyranny, he will go to paradise; but the man whose tyranny prevails over his justice will go to hell."
God's Messenger sent me to the Yemen as qadi and I said, “Messenger of God, are you sending me when I am young and have no knowledge of the duties of qadi He replied, “God will guide your heart and keep your tongue true. When two men bring a case before you do not decide in favour of the first till you hear what the other has to say, for it is best that you should have a clear idea of the best decision." He said he had no doubts about a decision afterwards.
Buraida reported God’s Messenger as saying, "Qadis are of three types, one of whom will go to paradise and two to hell. The one who will go to paradise is a man who knows what is right and gives judgment accordingly; but a man who knows what is right and acts tyrannically in his judgment will go to hell, and a man who gives judgment for people when he is ignorant will go to hell.”