Read Genesis Chapter 37
One day, all of the sons of Jacob (except Benjamin, of course, he was still too young) went out to feed the sheep in Shechem (as the land was still called at that time). Joseph stayed behind with his father.
Israel (as God had had renamed Jacob, meaning "Triumphant with God") asked Joseph, "Hey, aren't your brothers in Shechem today?" Then, he told Joseph, "Why don't you go see how they are doing for me?"
When Joseph got to Shechem, the brothers were not there. He wandered around looking for them until a man saw him and told him, "I heard them talking about going to Dothan. You might look there." So, Joseph went to Dothan.
The brothers saw him coming from a distance. "Look, the Dreamer is coming," they sneered. "Let's kill him and throw him in a pit. We'll just tell Dad that some wild animal got him. What will become of the Dreamer then?!" But Reuben, the oldest brother, was more protective.
"No, don't kill him. Just throw him into a pit." Reuben knew he couldn't "fight the mob", so to speak; but, if he was clever, he could rescue Joseph later.
When Joseph finally got there, they stripped off his precious "coat of many colors" that his father had made for him as a gift. Then, they threw him into a pit that had dried up. Then, as if nothing had happened, they sat down to eat.
I'm sure Joseph was terrified. His worst nightmare was coming true. The hurt he felt must have been enormous. He was stuck in a dark, empty well with no way out -- and he had yet to learn how much his brothers really hated him. In their jealousy, they couldn't see there faults. They didn't care about honoring God, or their father. The only right thing they did in this whole operation was keep him alive.
As the brothers ate, they looked up to see Ishmaelites going to Egypt with goods to trade. As Joseph cried from the well for mercy, Judah grinned as an idea suddenly struck him: "What good will it do us to kill Joseph? Let's sell him to our cousins, the Ishmaelites. He is our brother; Reuben is right. We shouldn't kill him."
However, before they could carry out their plan, a band of Midianites (also cousins) passed by the pit and heard Joseph's screams. They pulled him out and sold Joseph to the Ishmaelites for $2,500.00 (in today's currency, that is how much it came to).
When Reuben got to the pit, planning to do what the Midianites did, Joseph was already gone. "Oh no. What am I going to do now?" he thought.
Well, the brothers still had the coat that Joseph wore. They killed a newborn baby goat (because that would be easy to hide from his father. They could always say the nanny had miscarried), and they smeared it's blood on the coat. (Good thing for them that DNA testing hadn't been invented yet). They took the coat to their father, telling him that they had found his coat, but hadn't seen Joseph. This led Isaac to believe that his son had been killed by a wild animal.
Jacob/Israel was heartbroken. He mourned hard for Joseph and no one could comfort him. He vowed that he would mourn for Joseph until the day he died. Can you imagine the darkness of the guilt that his other sons eventually had to live with?
The Midianites sold Joseph to the Ishmaelites. The Midianites, remember, are also descended from Abraham, through a son by Abraham's second wife Keturah, after Sarah had died (Genesis 25:1,2) They sold Joseph to Potiphar, who just happened to be the Captain of the Guard for Pharoah, the king of Egypt. This sin did not only occur among Joseph's brothers, it occurred among his kinsmen, his cousins who did not know him.
Note: This is the first time I really noticed that his brothers did not sell him into slavery as I have been taught. The Bible clearly says that the Midianites pulled him out before they could carry out their plan. Oh yes, they were still guilty because of their intention, but they didn't actually commit the crime. (Read Matthew 5:20-30 to understand this further)