Genesis 40:4
The captain of the guard appointed Joseph to be with them, and he attended them. They continued for some time in custody.
Genesis 37:36
Meanwhile the Midianites had sold him in Egypt to Potiphar, an officer of Pharaoh, the captain of the guard.
Genesis 39:1
Now Joseph had been brought down to Egypt, and Potiphar, an officer of Pharaoh, the captain of the guard, an Egyptian, had bought him from the Ishmaelites who had brought him down there.
Genesis 39:21-23
But the LORD was with Joseph and showed him steadfast love and gave him favor in the sight of the keeper of the prison.
Psalm 37:5
Commit your way to the LORD; trust in him, and he will act.