The clause "the Lord was with Joseph" occurs four times in this chapter ( Genesis 39:2-3; Genesis 39:21; Genesis 39:23) and explains the reason for his success. The divine name "LORD," Yahweh, appears seven times in this chapter ( Genesis 39:2-3[1], 5 [1], 21 , and23) but only one other time in the Jacob toledot ( Genesis 37:2 to Genesis 50:26): in Genesis 49:18. God had previously promised to be with Isaac and Jacob ( Genesis 26:3; Genesis 26:24; Genesis 26:28; Genesis 28:15; Genesis 28:20; Genesis 31:3). Yahweh is the name for God used. The covenant-keeping God of the patriarchs was with this son of Jacob far from home. Joseph had a fine physique and a handsome face, features that he seems to have inherited from his mother Rachel (cf. Genesis 29:17). He proved faithful in a little and therefore the Lord placed him in charge of much (cf. Luke 16:10). Note that God blessed Potiphar because of Joseph (cf. Genesis 12:3 a). [source][source][source]
"The whole sequence of Genesis 39:2-6 is a particularly apt and clear example of the meaning of blessing in the Old Testament. Assistance and blessing belong together, though they are different. Blessing embraces both people and the rest of creation. The narrator simply presupposes that the blessing can flow over from the one whom Yahweh assists to a foreign people and adherents of a foreign religion precisely because of the one whom Yahweh assists. The power inherent in the blessing is expansive ..." [3][source]