23 So when Joseph arrived, his brothers ripped off the beautiful robe he was wearing. 24 Then they grabbed him and threw him into the cistern. Now the cistern was empty; there was no water in it. 25 Then, just as they were sitting down to eat, they looked up and saw a caravan of camels in the distance coming toward them. It was a group of Ishmaelite traders taking a load of gum, balm, and aromatic resin from Gilead down to Egypt. 26 Judah said to his brothers, "What will we gain by killing our brother? We'd have to cover up the crime. 27 Instead of hurting him, let's sell him to those Ishmaelite traders. After all, he is our brother-our own flesh and blood!" And his brothers agreed. 28 So when the Ishmaelites, who were Midianite traders, came by, Joseph's brothers pulled him out of the cistern and sold him to them for twenty pieces of silver. And the traders took him to Egypt. 29 Some time later, Reuben returned to get Joseph out of the cistern. When he discovered that Joseph was missing, he tore his clothes in grief. 30 Then he went back to his brothers and lamented, "The boy is gone! What will I do now?"

Matthew Henry's Commentary on Genesis 37:23-30

Commentary on Genesis 37:23-30

(Read Genesis 37:23-30)

They threw Joseph into a pit, to perish there with hunger and cold; so cruel were their tender mercies. They slighted him when he was in distress, and were not grieved for the affliction of Joseph, see Psalm 76:10. Joseph's brethren were wonderfully restrained from murdering him, and their selling him as wonderfully turned to God's praise.