Genesis 37:8

37:8 Then his brothers asked him, “Do you really think you will rule over us or have dominion over us?” They hated him even more because of his dream and because of what he said.

Genesis 39:20

39:20 Joseph’s master took him and threw him into the prison, the place where the king’s prisoners were confined. So he was there in the prison.