When interacting with others always regard whatever pleases and displeases yourself as the measure. Desire for others what your own ego desires and do not forget that whatever conduct displeases you will displease others. If you do this you will be safe not only from misconduct and bad behavior but also from hurting others.
Considering that favors received make you feel a liking affection and attachment for those who bestowed the favor upon you you should understand how to make others like you and feel affection and attachment for you. It is said that "people are the slaves of the favors done to them." Therefore doing others a favor and being good to them is a reliable defense against any harm that may come from them.
Maturity and perfection of spirit is being just in your treatment of others especially with those who have done you an injustice. Answer their evil with good. Do not stop doing good even to those who have harmed you. Rather treat them with humanity and nobility for harming someone is brutish behavior. Returning evil with evil implies a deficiency in character; returning good for evil is nobility.
There is no limit to doing good to others. Those who have dedicated themselves to the good of humanity can be so altruistic that they will even sacrifice their lives for others. However such altruism is a great virtue only if it originates in sincerity and purity of intention and if it does not define the "others" by racial preferences.
Our humanity and nobility are directly proportional to our closeness to our friends and our maintenance of these friendships. Talking of nobility and kindness without expressing warmth and intimacy in relationships is mere assertion. Doing good in return only for good received or sometimes ceasing to do good to others in order to punish them implies moral imperfection and immaturity.
It is a sign of great generosity and goodness to others if you ignore some of their faults improprieties or bad manners and tolerate their imperfections. Prying into others' affairs and finding fault is rude and uncivil and publicizing such affairs is unforgivable. Declaring them to the other's face is a severe blow to the bonds of unity between people a blow from which sadly it is almost impossible for friendship to recover fully.
Those who regard even the greatest good they have done for others as insignificant while greatly appreciating even the least favor done to themselves are perfected ones who have acquired the Divine standards of behavior and found peace in their conscience. Such individuals never remind others of the good they have done for them and never complain when others appear to be indifferent to them.