Joseph was very successful serving in the house of his new master, Potiphar, and the Torah relates that “the Lord was with him.” The Sages tell of Joseph’s adherence to God and his success, but also that he acted haughtily and forgot Jacob’s home.
You find that once he was in the house of his master, “The Lord was with Joseph, and he was a successful man; and he was in the house of his master, the Egyptian. His master saw that the Lord was with him, and all that he did, the Lord made his undertaking successful” (Genesis 39:2–3). Did the wicked Potiphar see that the Holy One, blessed be He, was with him? What is the meaning of the phrase “that the Lord was with him”? It means that the name of the Holy One, blessed be He, would not depart from Joseph’s mouth. Joseph would enter to serve Potiphar and he would whisper: Master of the Universe, You are my security, You are my patron; grant me grace, kindness, and compassion in Your eyes, in the eyes of all who see me, and in the eyes of Potiphar my master. Potiphar would say to him: What are you whispering? Perhaps you are performing sorcery against me. Joseph answered him: No; I am praying that I will find favor in your eyes. Once Joseph saw himself succeed as he did, he began eating and drinking, curling his hair, and saying: Blessed is the Omnipresent, who caused me to forget [the sorrow of being banished from] my father’s house. The Holy One, blessed be He, said to him: Your father is mourning over you in sackcloth and ashes, and you are eating and drinking and curling your hair? The wife of your master will harass you and will distress you. (Tanĥuma, Vayeshev)