In Genesis 39 Joseph is seen in the land of Egypt, for there the Midianites sold him. He is in slavery, first of all in the house of Potiphar, captain of the guard; but “Jehovah was with Joseph; and he was a prosperous man; and he was in the house of his master the Egyptian.” Here again he comes into suffering; here again most unworthily is he misrepresented and maligned, and hastily cast into the dungeon. But Jehovah was with Joseph in the prison, just as much as in Potiphar’s house.
In verse 2, it is written, He was with Joseph; in verse 21, He was with Joseph, “and showed him mercy, and gave him favor in the sight of the keeper of the prison. The keeper of the prison looked not to anything that was under his hand.”
It mattered little where he was, since Jehovah was with him. What a difference it makes when God is with us – God too in His special known relationship, which is implied in the use of “Jehovah” here as everywhere. “He looked not to anything that was under his hand, because Jehovah was with him; and that which he did Jehovah made it to prosper.”