The Messenger of Allah ﷺ said, "A Muslim is required to listen and obey in what he likes and dislikes, unless he is commanded to commit a sin. If he is commanded to commit a sin, then there is no listening and no obedience."
أخبرنا قتيبة قال حدثنا الليث عن عبيد الله بن أبي جعفر عن نافع
قال رسول الله ﷺ على المرء المسلم السمع والطاعة فيما أحب وكره إلا أن يؤمر بمعصية فإذا أمر بمعصية فلا سمع ولا طاعة