There is an old Chinese adage, taught by Confucius.
Which translates to “Do not do onto others what you don't desire.” However, this is a passive form of fairness, where inaction is permissible. Jesus makes a stronger statement,
So in everything, do to others what you would have them do to you, for this sums up the Law and the Prophets. ——Matthew 7:12
This requires action where inaction or indifference could cause harm to others.
There is a related teaching by Jesus,
“Do not judge, or you too will be judged. For in the same way you judge others, you will be judged, and with the measure you use, it will be measured to you.”——Matthew 7:1-2
This is often misinterpreted as “do not judge,” period. When interpreted this way, it is often used to as a straw-man argument to counter someone else's criticism towards you. However, Jesus is not giving anyone a license to act wicked and be immune from judgment. Jesus is not teaching that you can confuse right from wrong. The real teaching is for the judgment to be fair; that is, I judge others with the same criteria that I judge myself.
Some people will say, how about treating others how they want you to treat them? Definitely! The teaching of Jesus goes beyond being fair.
38 “You have heard that it was said, ‘Eye for eye, and tooth for tooth.’ 39 But I tell you, Do not resist an evil person. If someone strikes you on the right cheek, turn to him the other also. 40 And if someone wants to sue you and take your tunic, let him have your cloak as well. 41 If someone forces you to go one mile, go with him two miles. 42 Give to the one who asks you, and do not turn away from the one who wants to borrow from you. 43 “You have heard that it was said, ‘Love your neighbor and hate your enemy.’ 44 But I tell you: Love your enemies and pray for those who persecute you, 45 that you may be sons of your Father in heaven. He causes his sun to rise on the evil and the good, and sends rain on the righteous and the unrighteous. 46 If you love those who love you, what reward will you get? Are not even the tax collectors doing that? 47 And if you greet only your brothers, what are you doing more than others? Do not even pagans do that? 48 Be perfect, therefore, as your heavenly Father is perfect. ——Matthew 5:38-48
The idea is that we should treat others even better than how they want us to treat them, regardless how we are treated by them. Sometimes this means forfeiting justice. In a very superficial way, you are judged by the way you treat others, not by the way others treat you. If you respond to aggression by aggression, you would be perceived as an aggressive person.