Genesis 39:2 The LORD was with Joseph, and he was a successful man; and he was in the house of his master the Egyptian.
3 And his master saw that the LORD was with him and that the LORD made all he did to prosper in his hand.
4 So Joseph found favor in his sight, and served him. Then he made him overseer of his house, and all that he had he put under his authority.
Joseph's success was due to the LORD being with him. To me, this is very clear. I know from experience, my success in this life is due to the LORD being with me. Potiphar saw how the LORD was with him. How did he even know the LORD? Joseph must have shared his faith, pointed to the LORD, brought glory to the LORD. He could have been whiney, complaining, angry at life, but because of the LORD, he was not. when life served Joseph lemons, he made lemonade.