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:42:40

And the retribution for an evil act is an evil one like it, but whoever pardons and makes reconciliation - his reward is ˹due˺ from Allah. Indeed, He does not like wrongdoers.  

For the requital of an evil deed is an evil deed like it: the latter is ˹also˺ referred to as ‘an evil deed’ because in ˹outward˺ form it resembles the former; this is evident in what concerns retaliation for wounds. Some ˹scholars˺ say that even if another were to say, ‘May God disgrace you!’, then one should respond ˹equally˺ with, ‘May God disgrace you!’. But whoever pardons, his wrongdoer, and reconciles, the amity between himself and the one pardoned, his reward will be with God, that is to say, God will give him his reward without doubt. Truly He does not like wrongdoers, that is, those who initiate acts of wrongdoing and so merit His punishment.
القرآن:٤٢:٤٠

وَجَزَاءُ سَيِّئَةٍ سَيِّئَةٌ مِثْلُهَا ۖ فَمَنْ عَفَا وَأَصْلَحَ فَأَجْرُهُ عَلَى اللَّهِ ۚ إِنَّهُ لَا يُحِبُّ الظَّالِمِينَ  

{وجزاءُ سيئة سيئة مثلها} سميت الثانية سيئة لمشابهتها للأولى في الصورة، وهذا ظاهر فيما يقتص فيه من الجراحات، قال بعضهم: وإذا قال له أخزاك الله، فيجيبه أخزاك الله {فمن عفا} عن ظالمه {وأصلح} الود بينه وبين المعفو عنه {فأجره على الله} أي إن الله يأجره لا محالة {إنه لا يحب الظالمين} أي البادئين بالظلم فيترتب عليهم عقابه.