ادْفَعْ بِالَّتِي هِيَ أَحْسَنُ
Idfa‘ billatī hiya aHsan
Repel evil with what is best (Sūrat Fussilat, No. 41, Āyat 34)
One of the highest signs of a noble character is to be able to do good to someone who has been mean to you. It requires strength of character and an ego free mind. Most of us would initially think of retaliating, or at least withdrawing from the person. But Islam teaches us that to be truly successful is to not let the wrong done affect us. We should counter the mean act with a good one. The result is that the person between whom and you there was enmity would be as if he were a warm friend (41:34).
The Ma‘sūmīn (a) have taught us this noble trait through their dealings with people. Many of those who treated them with disrespect and abuse were shown gentleness and forgiveness. A person from Shām, for instance, came to Madīna and began verbal abuse against Imam al-Hasan al-Mujtaba (a). The Imam responded gently and offered him help and accommodation, since he was stranger in the city. Such exalted morals of the Infallibles (a) were a key factor in winning people over to Islam, and was behind the success of the leadership of the Holy Prophet (s). Of courses there will always be a small group of people who would not benefit from such gentleness and who would need to be treated firmly. These are the exceptions rather than the rule.
When the Muslims conquered Makkah, many of them felt they now had the upper hand over the people who had tortured them and turned them out from their homes. Some Muslims went around proclaiming that now it was the day of battle, and of taking revenge. When the Messenger of Allah, Prophet Muhammad (s) heard that, he immediately told them to stop. Instead he declared that now it was the day of mercy, and of showing kindness. He announced that he would say to the people of Makkah what Nabī Yūsuf (a) told his brothers: There shall be no reproof against you this day (12:92).
In life we will always get treatment that is not very pleasant from others. We must train ourselves to rise above it and not let it affect our own standards of behavior. Ultimately, it is not about us, but about the noble manners expected by the Creator. In Du‘ā Makārimul Akhlāq, Imam Zaynul ‘Ābidīn (a) prays for the tawfīq to be thus: O God . . . help me to answer him who is dishonest toward me with good counsel, repay him who separates from me with gentle devotion, reward him who deprives me with free giving, recompense him who cuts me off with joining relations to him (Du‘ā No. 20, passage 9)
It is a prayer we should recite all the time to remind ourselves of the need to repel evil with good.
Sources: Āytaullāh Nāsir Makārim Shirāzī (ed), Imam Zaynul ‘Ābidīn (a), Sahīfa Sajjādiyyah,
http://www.al-islam.org/islamic-family-life-ethics-ayatullah-husayn-mazaheri/twenty-second-talk