Narrated Buraida (RA) Allah's Messenger (ﷺ) said:
"al-Qudat (judges) are of three types, two of whom will go to Hell and one to Paradise. The one who will go to Paradise is a man who knows what is right and gives judgement accordingly. However, a man who knows what is right, and does not give judgement accordingly and acts unjustly in his judgement, will be in the Hell-fire. Likewise, a man who does not know what is right and judges people with ignorance, will be in the Hell-fire."[Reported by al-Arba'a, and al-Hakim graded it Sahih (authentic)]. (ES)
Reference (ES): Bulugh al-Maram 1397 (ES)
In-book reference (ES): Book 14, Hadith 1 (ES)
English translation (ES): Book 14, Hadith 1397 (ES)