לֹֽא־תִקֹּ֤ם וְלֹֽא־תִטֹּר֙ אֶת־בְּנֵ֣י עַמֶּ֔ךָ וְאָֽהַבְתָּ֥ לְרֵעֲךָ֖ כָּמ֑וֹךָ אֲנִ֖י ה׳׃
You shall not take vengeance or bear a grudge against your countrymen. Love your fellow as yourself: I am HaShem.
שְׁמַ֖ע יִשְׂרָאֵ֑ל ה׳ אֱלֹקֵ֖ינוּ ה׳ ׀ אֶחָֽד׃ וְאָ֣הַבְתָּ֔ אֵ֖ת ה׳ אֱלֹקֶ֑יךָ בְּכָל־לְבָבְךָ֥ וּבְכָל־נַפְשְׁךָ֖ וּבְכָל־מְאֹדֶֽךָ׃
Hear, O Israel! HaShem is our God, HaShem is one.You shall love HaShem your God with all your heart and with all your soul and with all your might.
ואהבת לרעך כמוך. אָמַר רַבִּי עֲקִיבָא זֶה כְּלָל גָּדוֹל בַּתּוֹרָה:
LOVE YOUR FELLOW AS THYSELF —Rabbi Akiba said: “This is a fundamental principle of the Torah”
ורבי יוחנן האי וחי אחיך עמך מאי עביד ליה מבעי ליה לכדתניא שנים שהיו מהלכין בדרך וביד אחד מהן קיתון של מים אם שותין שניהם מתים ואם שותה אחד מהן מגיע לישוב דרש בן פטורא מוטב שישתו שניהם וימותו ואל יראה אחד מהם במיתתו של חבירו עד שבא ר' עקיבא ולימד וחי אחיך עמך חייך קודמים לחיי חבירך
What does Rabbi Yoḥanan, do with the verse: “And your brother shall live with you”?He requires the verse for that which is taught: If two people were walking on a path and one of them hasa jug of water, and if both drink from it, both will die, as there isn't enough water, but if only one of them drinks, he will reach a settled area.Ben Petora taught: It's preferable that both should drink and die, and neither one see the death of the other. This was the accepted opinion until Rabbi Akiva came and taught that the verse states: “And your brother shall live with you,” indicating that your life takes precedence over the life of another.
(יח)ואהבת לרעך כמוך אר"ע זה כלל גדול בתורה יש לפרש ר"ע לטעמי' דדרש ר"פ איזהו נשך וחי אחיך עמך חייך קודמין לחיי חבירך וא"כ כיון שחייך קודמין איך אפשר לקיים ואהבת לרעך כמוך מיהו הא דחייך קודמין היינו בעניני עוה"ז אבל בחיי הנצחיי דהיינו בלימוד התורה חייב ללמד לאחרים אפי' הוא מבטל עצמו מלימודו מ"מ חייב ללמד עם אחרים וע"כ אמר ר"ע זה כלל גדול בתורה דבענין לימוד התורה הוא כלל גדול לאהוב חבירו כמוך (מ"מ לא אמר רק כמוך כי עי"ז שמלמד לאחרים גם הוא עושה מצוה ומזכה עצמו ושניהם שוים):
Rabbi Akiva says loving your neighbor as yourself, is the primary principle of the Torah. One can explain this alongside another statement of Rabbi Akiva, in which he rules that if you only have one canteen of water, you should keep it for yourself, as your life takes priority to others'. One can ask, what about loving your neighbor as yourself? The answer is that prioritizing your life is talking about your physical existence, while loving your neighbor as yourself is referring to eternal life...that's why Rabbi Akiva says it's a the primary principle batorah, not as generally understood 'that's documented in the Torah, rather within Torah, meaning within the spiritual realm, within Torah.
ואף אם רואה בחבירו שום דבר רע, ישנא הרע שבו, אך החלק הקדוש יאהבנו מאד כנפשו, כי הבעש״ט נבג״מ אמר שהצדיק הגמור שאין רע בקרבו אין רואה שום רע על שום אדם, אך מי שרואה שום רע בחבירו, הענין הוא כמו שמסתכל במראה, אם פניו מטונפין רואה גם כן במראה כך, ואם פניו נקיים אינו רואה במראה שום דופי, כמו שהוא כך רואה, וזהו (ויקרא י״ט, י״ח) ואהבת לרעך כמוך, פי׳ כמוך כמו שאם יודע האדם בעצמו שום רע בקרבו משום הא אינו שונא את עצמו אף ששונא הרע שבקרבו, כך גם כן על חבירו, כי באמת הכל אחד,כי הלא גם לחבירו יש גם כן חלק אלוק כמוהו ויש לו אות בתורה.
And even if you see something wrong in your friend, you should hate only that aspect of him, but you must love his spiritual part a lot. For the Baal Shem Tov zt'l said that a righteous person, that has no negativity in his heart, doesn't see bad in others. However, one who sees bad in their friends, it's as if he's looking into a mirror. If his face his dirty, he sees that in the mirror, and the same if its clean. This is what "you shall love your neighbor as yourself" means. As yourself; the same way one doesn't hate himself, despite knowing his own shortcomings, so too you should treat your friend "as yourself".

