An-Nahl 16:126
وَإِنْ عَاقَبْتُمْ فَعَاقِبُوا۟ بِمِثْلِ مَا عُوقِبْتُم بِهِۦ ۖ وَلَئِن صَبَرْتُمْ لَهُوَ خَيْرٌ لِّلصَّـٰبِرِينَ
Wa-in AAaqabtum faAAaqiboobimithli ma AAooqibtum bihi wala-in sabartum lahuwakhayrun lissabireen
And if you punish [an enemy, O believers], punish with an equivalent of that with which you were harmed. But if you are patient - it is better for those who are patient.
And if you were to harm (them) in retaliation, harm them to the measure you were harmed. And if you opt for patience, it is definitely much better for those who are patient.