You intended to harm me, but God intended it all for good.Genesis 50:20
Everyone faces adversity from time to time. A person is fired from his or her job. Bills are due, but there's no money to pay them with. A beloved family member dies. How we handle these situations can say a lot about our faith in the Lord.
In the case of Joseph, his problems began the moment he fell for his brothers' "we've got a really neat pit to show you" trick. They sold him as a slave to Ishmaelites passing through the area in an attempt to rid themselves of "the dreamer" (see Genesis 37:19). Eventually, Joseph was able to gain a good standing with Potiphar and was placed in charge of his house. But later, Potiphar's wife attempted to seduce Joseph and falsely accused him of adultery. Joseph ended up in prison as a result.
Joseph had plenty of opportunities to cry out about the injustice he was facing. He had chances to complain about the treatment he had received from his brothers. He could have become bitter when the king's cupbearer was released from prison and forgot about him. These actions and attitudes would have reduced Joseph to hopelessness.
Instead, Joseph allowed himself to be used by God to interpret Pharaoh's dream. Pharaoh removed him from prison and placed him in charge of Egypt, where he organized a plan to store grain before the famine occurred. Finally, Joseph was reunited with his brothers. What was intended for bad was used by God for good.
Obstacles have the ability to take us out of contention, but we also have the opportunity to rise above them. We can cry, complain, and live in misery because of our struggles. Or we can react like Joseph--allowing God, in his timing, to bring something good out of our circumstances. Are you allowing God to help you land on your feet?