Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:4:80

He who obeys the Messenger has obeyed Allah; but those who turn away - We have not sent you over them as a guardian.  

Whoever obeys the Messenger, verily obeys God; and whoever turns his back, ˹whoever˺ avoids obedience to you, do not be concerned with them: We have not sent you as a watcher over them, to keep watch over their deeds, but as a warner. Their affair is Ours ˹to deal with˺ and We will requite them. This ˹statement˺ was before the command to fight ˹them was revealed˺.
القرآن:٤:٨٠

مَنْ يُطِعِ الرَّسُولَ فَقَدْ أَطَاعَ اللَّهَ ۖ وَمَنْ تَوَلَّىٰ فَمَا أَرْسَلْنَاكَ عَلَيْهِمْ حَفِيظًا  

{من يطع الرسول فقد أطاع الله ومن تولى أعرض عن طاعتك فلا يهمنَّك {فما أرسلناك عليهم حفيظا} حافظا لأعمالهم بل نذيرا وإلينا أمرهم فنجازيهم وهذا قبل الأمر بالقتال.