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:23:96

Repel, by ˹means of˺ what is best, ˹their˺ evil. We are most knowing of what they describe.  

Ward off with that which is better, that is to say, with the ˹better˺ trait of pardoning and shunning them, the evil ˹act˺, the hurt they cause you — this was ˹revealed˺ before the command to fight ˹them˺. We know best what they allege, ˹what˺ they invent of lies and ˹what they˺ say and so We will requite them for it.
القرآن:٢٣:٩٦

ادْفَعْ بِالَّتِي هِيَ أَحْسَنُ السَّيِّئَةَ ۚ نَحْنُ أَعْلَمُ بِمَا يَصِفُونَ  

{أدفع بالتي هي أحسن} أي الخصلة من الصفح والإعراض عنهم {السيئة} أذاهم إياك وهذا قبل الأمر بالقتال {نحن أعلم بما يصفون} يكذبون ويقولون فنجازيهم عليه.