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, shall we not then take up the sword against them?"He replied, "No, not as long as they establish the prayer among you. If you see something from your rulers that you dislike, then hate their deed, but do not withdraw your hand from obedience."

Muslim 4804

Sahih

حدثنا إسحق بن إبراهيم الحنظلي أخبرنا عيسى بن يونس حدثنا الأوزاعي عن يزيد بن يزيد بن جابر عن رزيق بن حيان عن مسلم بن قرظة

عن عوف بن مالك

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

مسلم 4804صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Leadership
Chapter
Best and worst of leaders
Numbering
Darussalam 4804
Muslim 4804