Parshas Behar: חייך קודמין לחיי חבירך מנחת אשר ויקרא סימן נט

(לו) אַל־תִּקַּ֤ח מֵֽאִתּוֹ֙ נֶ֣שֶׁךְ וְתַרְבִּ֔ית וְיָרֵ֖אתָ מֵֽאֱלֹקֶ֑יךָ וְחֵ֥י אָחִ֖יךָ עִמָּֽךְ׃

(36) do not exact from him advance or accrued interest, but fear your God. Let him live by your side as your kinsman.

שנים שהיו מהלכין בדרך וביד אחד מהן קיתון של מים אם שותין שניהם מתים ואם שותה אחד מהן מגיע לישוב דרש בן פטורא מוטב שישתו שניהם וימותו ואל יראה אחד מהם במיתתו של חבירו עד שבא ר' עקיבא ולימד וחי אחיך עמך חייך קודמים לחיי חבירך

The Gemara asks: And Rabbi Yoḥanan, what does he do with this verse: “And your brother shall live with you”? The Gemara answers: He requires the verse for that which is taught in a baraita: If two people were walking on a desolate path and there was a jug [kiton] of water in the possession of one of them, and the situation was such that if both drink from the jug, both will die, as there is not enough water, but if only one of them drinks, he will reach a settled area, there is a dispute as to the halakha. Ben Petora taught: It is preferable that both of them drink and die, and let neither one of them 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 the other.

לא סלקא דעתך מדאקיל רחמנא לגביה דתניא (דברים טו, טז) כי טוב לו עמך עמך במאכל ועמך במשתה שלא תהא אתה אוכל פת נקיה והוא אוכל פת קיבר אתה שותה יין ישן והוא שותה יין חדש אתה ישן על גבי מוכים והוא ישן על גבי התבן מכאן אמרו כל הקונה עבד עברי כקונה אדון לעצמו

Abaye answered: It cannot enter your mind to expound the verses stringently, as indicated from the fact that the Merciful One is lenient with regard to a slave and is concerned about his well-being. As it is taught in a baraita: The verse states concerning a Hebrew slave: “Because he fares well with you” (Deuteronomy 15:16), which teaches that the slave should be with you, i.e., treated as your equal, in food, meaning that his food must be of the same quality as yours, and with you in drink. The baraita continues: This means that there shall not be a situation in which you eat fine bread and he eats inferior bread [kibbar], bread from coarse flour mixed with bran, which is low quality. There shall not be a situation in which you drink aged wine and he drinks inferior new wine. There shall not be a situation in which you sleep comfortably on bedding made from soft sheets and he sleeps on straw. From here the Sages stated: Anyone who acquires a Hebrew slave is considered like one who acquires a master for himself, because he must be careful that the slave’s living conditions are equal to his own.
כל הקונה עבד עברי כקונה אדון לעצמו - וקשה מאי אדון די לו להיות כאדונו ויש לומר כדאיתא בירושלמי דפעמים אין לו אלא כר אחת אם שוכב עליו בעצמו אינו מקיים כי טוב לו עמך ואם אינו שוכב עליו וגם אינו מוסרו לעבדו זו מדת סדום נמצא שע"כ צריך למסור לעבדו והיינו אדון לעצמו: