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."
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.”
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!"
Anas reported God’s Messenger as saying, “If anyone desires and asks for the office of qadi he will be left to his own devices, but if anyone is forced to accept it God will send down an angle who will direct him aright.”