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:16:82

But if they turn away, ˹O Muhammad˺ - then only upon you is ˹responsibility for˺ clear notification.  

But if they turn away, ˹if˺ they reject Islam, your duty, O Muhammad (s), is only to convey ˹the Message˺ plainly — this was ˹revealed˺ before the command to fight ˹the disbelievers˺.
القرآن:١٦:٨٢

فَإِنْ تَوَلَّوْا فَإِنَّمَا عَلَيْكَ الْبَلَاغُ الْمُبِينُ  

{فإن تولوْا} أعرضوا عن الإسلام {فإنما عليك} يا محمد {البلاغ المبين} الإبلاغ البيِّن وهذا قبل الأمر بالقتال.

See similar narrations below:

Collected by Qurʾān
quran:3:63

But if they turn away, then indeed - Allah is Knowing of the corrupters.  

And if they turn their backs, rejecting faith, assuredly God knows the agents of corruption, and will requite them (here the ˹third person˺ pronominalisation has been replaced with the overt noun ˹al-mufsidūn, ‘the agents of corruption’˺).
القرآن:٣:٦٣

فَإِنْ تَوَلَّوْا فَإِنَّ اللَّهَ عَلِيمٌ بِالْمُفْسِدِينَ  

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