Matthew 7:12 is the text of what we call the Golden Rule. It states "So whatever you wish that others would do to you, do also to them, for this is the Law and the Prophets." It has now been a couple of years since we worked through this portion of Matthew's gospel, but it comes up all the time. The fact is that nearly every society on earth has some sort of version of this. However, the Bible's portrayal is unique. Others frame it in terms of the negative, such as “Do not do to others what you wouldn’t want them to do to you” – i.e. don’t hit someone, don’t lie to them, don’t steal from them, don’t extort them, etc.
Interestingly, Jesus understands that our natural tendency is to think of ourselves and so He capitalizes on that when he gives the rule. He doesn't tell us to stop thinking of ourselves, but rather to channel that into thinking about others.
Now, let us consider this: the Golden Rule focuses on our own conduct. When we think about how we interact with others, we do so with self-consideration. How would you feel if someone treated you the way you're about to treat this person?
What about another person who treats you not according to the Golden Rule? Actually, the rule still applies, because it is not what the other person deserves for treating you poorly, but your reaction should be framed to consider how you would like a person to respond to you if you had treated them poorly. For this, the wisdom of Solomon weighs in. Proverbs 24:29 says "Do not say, 'I will do to him as he has done to me; I will pay the man back for what he has done.'"
We ought to be humble and gracious in all our conduct toward others, and when we are wronged, we still ought to be humble and gracious.