The Bible account of Joseph and his brothers has been taught to youth all over the world for years, decades even. Recently while studying, I saw something in this account of what happened to Joseph.
It seemed like a bad situation for him. His brothers all coming against him due to jealously. The scriptures say "and when his brethren saw that their father loved him more than all his brethren they hated him, and could not speak peaceably unto him." Genesis 37:4. Joseph was a dreamer. His father, Jacob, had dreams too (Jacobs ladder). In Joseph's dream, he saw that his brothers sheaf's made obeisance to Jacobs sheaf's. This made his brothers hate him more. But this dream did come to pass.
One day Jacob sent Joseph to see about his brothers as they were feeding their father's flock. When they saw Joseph coming, they conspired against him to slay him. But instead, they sold Joseph to the Ishmeelites for twenty pieces of silver. The Ishmeelites in turn sold Joseph into Egypt unto Potiphar. This deed put Joseph in Egypt long before the famine came. Genesis 39:1-6 tells how Joseph's new master saw that the Lord was with him and that the Lord made all he did to prosper. The new master made Joseph over see in his house and over all that he had.
Of course there were obstacles Joseph was accused of something he did not do and was placed in prison. But the Lord was with Joseph in prison too Gen. 39:20,21). While in prison, Joseph was called to interpret the kings dreams. This led to Joseph being brought out of prison and placed once again in a position of authority in Egypt.
Then the famine came. And, Joseph was the governor over the land and he was the one that sold to all the people of the land. When his brothers came to buy corn at the direction of their father, Jacob, the brothers did not recognize Joseph, but Joseph knew his brethren. Joseph's dream was coming to pass.
When time came for Joseph to made himself known to his brothers (Genesis 45:4). Joseph said something to them that stands as a testament to how God works on behalf of His people. "AND GOD SENT ME BEFORE YOU TO PRESERVE YOU A POSTERITY IN THE EARTH AND TO SAVE YOUR LIVES BY A GREAT DELIVERANCE. SO NO, IT WAS NOT YOU THAT SENT ME HITHER, BUT GOD:" Genesis 45:7,8
Romans 8:28 says it like this, "And we know that all things work together for good to them that love God, to them who are the called according to his purpose."
Those that serve the Lord, have a God on their side that will be a battle ax. What Joseph's brothers did to him was all part of God's plan for his people. Even in their evil deed, God was making provisions for them. God is a good God.
"And Joseph said unto them Fear not: for am I in the place of God? But as for you, ye thought evil against me but God meant it unto good, to bring to pass, as it is this day, to save much people alive." Genesis 50:19.20. What God did through Joseph blessed all the people of God in time of famine.
Serve the Lord. Go through your tests. Stay with the Lord during your test and God will make all things work together for your good and the be a blessing to someone that just may be watching you to see how you serve the Lord.