Sunan Abi Dawud, Book 25, Hadith 5 (Abu Dawud 3576)
Narrated AbuHurayrah:
The Prophet (ﷺ) said: If anyone seeks the office of judge 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.