The opening phrase of verse 2 sums up very well the life of Israel's choice son: "...the Lord was with Joseph..." So, what were the effects of God's presence? Safety, prosperity, acceptance, wisdom, diligence, responsibility and temptation... yes, temptation. Anyone who walks with God is shortly going to be a target of Satan. Joseph was no exception.
Joe became the master of his master's house. His master was Potiphar, captain of the Egyptian guard. In Joseph's role as chief steward, he was both trusted and trustworthy. But, it seems that the astute ways of this young man helped to make him an appealing target for a wicked and licentious woman. The wife of Joseph's master fell for Joseph... and she wasn't subtle about it either. "Lie with me!" she said to him day after day (Genesis 39:7 & 10). Finally, when she was alone with him in the house, she literally took hold of him and attempted to force him into her bed. Her insatiable determination to have Joseph was so consuming that he literally had to run out of his robe to get away from her.
Now, lest you and I ever imagine that if we would just "do the right things" then God would automatically solve all of our problems and fix all of our pains... notice that Joseph did the right thing and it cost him his job. Potiphar's wife lied about the situation. She accused Joseph of doing the thing that she was actually guilty of doing. So Joe went to jail! But God was with him there too. Joseph became as influential and prosperous in the prison as he had been in the house of Potiphar. Only now he was one step closer to where he needed to be... in the palace.