The story of Joseph is one of my favorites for many reasons but especially to show that God’s purpose is working through everything, the good, the bad and the ugly. Joseph was thrown in a pit, sold by his brothers as a slave, shipped off to a foreign country and accused of attempted rape and thrown in jail. But he was in a place where he could use the gift God gave him with his dreams that would end up helping the Pharaoh and the whole nation of Egypt 
Genesis 50:19-20  But Joseph said to them, “Don’t be afraid. Am I in the place of God? You intended to harm me, but God intended it for good to accomplish what is now being done, the saving of many lives. 
 
 
