Answer:
The account of Joseph's life can be found at (Genesis 37:1-41:49).
Because of jealousy, he was sold into slavery by his own brothers and falsely imprisoned by the wife of Potiphar. Though difficult to endure, these experiences turned out to be God's will and an ultimate benefit for not only Joseph, but the whole nation of Israel. Joseph got out of prison by remaining obedient to God, even under these stressful circumstances. While wrongfully imprisoned, Joseph correctly interpreted dreams for Pharaoh's servants (Genesis 41:9-13), and then for Pharaoh himself (Genesis 41:14-36) leading to Pharaoh making him second in command in Egypt.(Genesis 41:37-46)