Sunan Ibn Majah — The Chapters on Rulings — Hadith No: 2309
Translation
It was narrated from Anas bin Malik that the Messenger of Allah (ﷺ) said:“Whoever asks to be appointed a judge, will be entrusted to himself, but “Whoever asks to be appointed a judge, will be entrusted to himself, but whoever is forced to accept position, an angel will come down to him and guide him.' ”