All of these are matters to which we must pay close attention, and we must follow them in the very path trodden by the People of the Sunnah and the Community. Whoever wishes to know this in detail should consult the books of the Sunnah written on the subject; there he will see how the leading scholars of this nation honor the rulers, and how they carry out the Prophet’s command to forgo rebellion and to listen and obey in everything that is not sinful.
Shaykh al-Islam Ibn Taymiyyah—may Allah have mercy on him—states at the end of al-ʿAqīdah al-Wāsiṭiyyah, a brief creed whose meaning is vast, that it is part of the guidance and method of Ahl al-Sunnah wa-l-Jamāʿah to profess loyalty to those in authority. They hold that pilgrimage, jihad, ʿEid observances, and Friday prayers are to be carried out under the leadership of the rulers, whether those rulers are pious or flagrant sinners. Even if the ruler is openly immoral, Ahl al-Sunnah still deem it obligatory to conduct jihad with him and to perform the pilgrimage, the Friday congregational prayer, and the ʿEid prayers alongside him.
The only exception arises when we see manifest, undeniable unbelief—plain kufr for which we have conclusive proof from Allah. In that situation, and to the extent of our ability, we must remove that ruler and replace him with someone better. But as for ordinary sins, self-interest, and similar faults, Ahl al-Sunnah maintain that the ruler’s authority remains intact despite them; he is still to be heard and obeyed, and it is forbidden to rebel against him, to inflame people’s hearts against him, or to engage in anything else that would bring about even greater corruption.
Evil is not repelled by evil; repel evil with good. If you confront evil with another evil of equal force, no benefit is gained, and if the second evil is greater—as is usually the case in such matters—then