Vayikra25:39

וְכִי־יָמוּךְ אָחִיךָ עִמָּךְ וְנִמְכַּר־לָךְ לֹא־תַעֲבֹד בּוֹ עֲבֹדַת עָבֶד׃

And if your brother becomes poor beside you and sells himself to you, you shall not make him work the work of a slave.

Vayikra 25:39

וְכִי־יָמוּךְ אָחִיךָ עִמָּךְ

Vayikra / Leviticus 25:39 · Drash

Vayikra 25:39

וְכִי־יָמוּךְ אָחִיךָ עִמָּךְ וְנִמְכַּר־לָךְ לֹא־תַעֲבֹד בּוֹ עֲבֹדַת עָבֶד׃

And if your brother becomes poor beside you and sells himself to you, you shall not make him work the work of a slave.

Drash דְּרָשׁ

Where is the covenant?

When you are treated unfairly, you want words that cannot be refuted. Yehudah (Judah) found them in the Torah.

Aggadat Bereshit: Yehudah said to the ruler of Egypt: we all have one Father, why do you betray us? We returned the money we found, kept every condition, and you say: "The one with whom the goblet was found shall be my slave." Where is the covenant the Eternal made in the Torah: "you shall not make him work the work of a slave"? Midrash Lekach Tov: even when a brother sold himself, treat him as a brother and do not lord it over him.

How Aggadat Bereshit and Midrash Lekach Tov explain it

Aggadat Bereshit You shall not make him work the work of a slave

"And Yehudah came near to him" (Bereshit / Genesis 44:18). Of this Scripture says: "Have we not all one Father? Did not one God create us?" (Malachi 2:10). "We, your servants, are twelve brothers, the sons of one man" (Bereshit / Genesis 42:13). Not like the nations of the world, and not like the Egyptians, who bow to every kind of idol, as it says: "and do not defile yourselves with the idols of Egypt" (Yechezkel / Ezekiel 20:7). But for us, heaven forbid, only one God created us (Malachi, there). If so, "why do we betray one another?" (Malachi, there).

Why do you betray us? At first, when we found the money in the mouths of our sacks, we did not keep it but returned it, as it says: "Behold, the money that we found" (Bereshit / Genesis 44:8). And you betray us and say: "The one with whom the goblet is found" (Bereshit / Genesis 44:17). The covenant the Holy One, blessed is He, made with the fathers, we profane? And more than that, the conditions we set between us. Did you not say: "If you are honest" (Bereshit / Genesis 42:19), and "your youngest brother" (Bereshit / Genesis 42:20)? And our father did not want it, and we set a condition with him too, as it says: "If I do not bring him to you" (Bereshit / Genesis 43:9). And you say: "The one with whom the goblet is found."

If so, where is the covenant the Holy One, blessed is He, set in His Torah and said to us: "but over your brothers, the children of Israel, you shall not rule one over another with harshness" (Vayikra / Leviticus 25:46), and it is written: "you shall not make him work the work of a slave" (Vayikra / Leviticus 25:39)? Therefore: "why do we betray one another?" (Malachi 2:10).

Midrash Lekach Tov And if your brother becomes poor

A person is sold only if he became poor. "And sells himself to you": "to you" and "sells himself" first, and not to idol worshippers. And so it says: "If your brother, a Hebrew man or a Hebrew woman, is sold to you" (Devarim / Deuteronomy 15:12). Another reading. "And if your brother becomes poor": though he sold himself, treat him as a brother. "Beside you": that you should not lord it over him. "And sells himself to you": his sins caused him to be sold, and still "you shall not make him work the work of a slave": that he should not carry things before you to the bathhouse.

Another reading. "You shall not make him work the work of a slave": by him you are not served with a slave's work, but by a free man you are served with a slave's work. From here they said: every work a slave does for his master, a student does for his teacher, except putting on his sandals and washing his face, hands and feet. And this is in a place where the student is not known as a free man. But in a place where the student is known to many and all know that he does it out of honour for his teacher, it is allowed. Therefore they said: a student should not bathe with his teacher in the bathhouse, unless the teacher needs him.

Takeaway

Yehudah says these words to Yosef (Joseph), when he, not yet revealed to his brothers, wanted to keep Binyamin (Benjamin) as his slave (Bereshit / Genesis 44:17–34).
Aggadat Bereshit is a collection of midrashim on the book of Bereshit, where verses of the Prophets and Psalms are matched to each chapter.
Midrash Lekach Tov is a Torah commentary by Rabbi Tuviah ben Eliezer, compiled in Byzantium around 1100.
The rule of student and teacher is in the Talmud too, in the words of Rabbi Yehoshua ben Levi: a student serves his teacher in everything a slave does, except removing his shoes (Ketubot 96a).