Awf bin Malik reported,

The Messenger of Allah ﷺ said, "The best of your leaders are those whom you love and who love you, who pray for you and for whom you pray. The worst of your leaders are those whom you hate and who hate you, whom you curse and who curse you."Someone asked, "Messenger of Allah, should we not take up the sword against them?"He replied, "No, not as long as they establish the prayer among you. If you see something objectionable from your rulers, then dislike their action, but do not withdraw your hand from obedience."

Azami 7614

Sahih

عن عوف بن مالك

عن رسول الله ﷺ قال: خيار أئمتكم الذين تحبونهم ويحبونكم ويصلون عليكم وتصلون عليهم، وشرار أئمتكم الذين تبغضونهم ويبغضونكم وتلعنونهم ويلعنونكم، قيل: يا رسول الله أفلا ننابذهم بالسيف؟ فقال: لا، ما أقاموا فيكم الصلاة وإذا رأيتم من ولاتكم شيئا تكرهونه فاكرهوا عمله، ولا تنزعوا يدا من طاعة.

الأعظمي 7614صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Leadership
Section
Leaders of the best qualities
Numbering
Jami al-Kamil 7614 (2nd edition)
Azami 7614