Bereishit 37:23 – 37:36
Joseph Gets Sold To Egypt
When Joseph reached his brothers, they took off his tunic and threw him into a pit, which had no water. [It may have had no water, but it could well have had scorpions and snakes.]
After throwing Joseph into a pit, the brothers sat down for a meal. This shows that Joseph’s brothers really believed they were doing the right thing.

When he saw a caravan of Ishmaelites headed their way, carrying spices to Egypt, Judah spoke up, “We have nothing to gain from killing our brother and covering up the blood. Let’s sell him to the Ishmaelites. We won’t lay a hand on him, for he is our brother.” His brothers agreed, except Reuben was not there.
Apparently there were a series of sales that occurred. The brothers took Joseph out of the pit and sold him to Ishmaelites, who sold him to Midianites, and the Midianites brought him to Egypt to sell him there.
Meanwhile, Reuben came back to the pit, and Joseph wasn’t there. Reuben tore his clothing, as is the custom for someone who is grieving. He went to his brothers and asked them, what do we do next?
They took Joseph’s tunic and dipped it in goat’s blood. When they brought the tunic to their father, he identified it as the one he had given to Joseph. Jacob rent his own clothes, believing that Joseph was eaten by some savage animal. And Jacob commenced to mourn for his son for what he thought would be the rest of his life.
In Egypt, the Midianites sold Joseph to Potiphar, the Chamberlain of the Butchers.