Genesis 37:36

37:36 Now in Egypt the Midianites sold Joseph to Potiphar, one of Pharaoh’s officials, the captain of the guard.

Genesis 39:1

Joseph and Potiphar’s Wife

39:1 Now Joseph had been brought down to Egypt. An Egyptian named Potiphar, an official of Pharaoh and the captain of the guard, purchased him from the Ishmaelites who had brought him there.

Genesis 39:21-23

39:21 But the Lord was with Joseph and showed him kindness. He granted him favor in the sight of the prison warden. 39:22 The warden put all the prisoners under Joseph’s care. He was in charge of whatever they were doing. 39:23 The warden did not concern himself with anything that was in Joseph’s care because the Lord was with him and whatever he was doing the Lord was making successful.

Psalms 37:5

37:5 Commit your future to the Lord!

Trust in him, and he will act on your behalf.