Vayikra / Leviticus 19:18 · Pshat
לֹא־תִקֹּם וְלֹא־תִטֹּר אֶת־בְּנֵי עַמֶּךָ וְאָהַבְתָּ לְרֵעֲךָ כָּמוֹךָ אֲנִי יְהוָה׃
You shall not take vengeance and you shall not bear a grudge against the children of your people, and you shall love your neighbour as yourself. I am the Eternal.
Pshat פְּשָׁט
Do not take vengeance, do not bear a grudge
Yesterday your neighbour would not help you, and today he asks you for help. Refusing him in return seems fair. But is it?
Rashi: taking vengeance means refusing someone who refused you yesterday, and bearing a grudge means helping him but reminding him you are not like him. Shadal: other wrongs against a neighbour are bad in themselves, but vengeance looks just. So beside it it says "love your neighbour as yourself": as you do not want others to take vengeance on you, so do not take it yourself.
How Rashi and Shadal explain it
Rashi You shall not take vengeance
One said to another: "Lend me your sickle." He answered: "No." The next day the second says to the first: "Lend me your axe." And he answers: "I will not lend it to you, just as you did not lend to me." That is vengeance. And what is bearing a grudge? One said to another: "Lend me your axe." He answered: "No." The next day the second says: "Lend me your sickle." And he answers: "Here, take it. I am not like you, for you did not lend to me." That is bearing a grudge: he keeps the hatred in his heart, though he does not take vengeance.
Shadal And you shall love your neighbour as yourself
All the other wrongs between a person and his fellow are abhorrent in themselves, except vengeance, which looks like a just judgement. So about it He said "love your neighbour as yourself": as you do not want others to take vengeance on you, so do not take vengeance on your neighbour, even if by law your vengeance would be justified. And so in everything: want for your neighbour what you would want for yourself. And Ramban explained: love your neighbour in all the ways of love with which you love yourself, and the equality will be in the quality of the love, not in its quantity, where there is no clash between the two things loved. But this is close to the trait of Sodom ("what is mine is mine, and what is yours is yours"). For how can I do good to my fellow without any loss or effort, light or heavy, coming to me? Between my benefit and another's benefit there is always, by necessity, a clash, and I cannot give my fellow a coin without that coin going missing from my pocket.
Takeaway
The Mishnah says that one who says "what is mine is mine, and what is yours is yours" holds a middle trait, and some sages call it the trait of Sodom (Mishnah Avot 5:10).
Ramban writes on this verse: the Torah does not require loving another as strongly as oneself, but wishing him good in everything as one wishes it for oneself (Ramban on Vayikra / Leviticus 19:18).