Genesis 40:8
And they said unto him, We have dreamed a dream, and there is no interpreter of it. And Joseph said unto them, Do not interpretations belong to God? tell me them, I pray you. And they said unto him, We have dreamed a dream, and there is no interpreter of it. And Joseph said unto them, Do not interpretations belong to God? tell me them, I pray you.
Joseph was still confined in prison when Pharaoh became offended with his chief butler and chief baker, had them cast into prison, and placed them under Joseph's especial care. One morning while bringing them food he noticed they looked very sad and kindly asked why they looked sad. When they answered that they had dreamed a dream with no one to explain it, he affirmed that the ability and power to explain dreams belongs to God and asked them to tell the dreams to him.
God enabled him to explain what the dreams meant, foretelling that in three days the butler would be restored to the king's favor to serve his cup as before and that the baker would die, and the interpretations came true as foretold. That encounter formed a turning-point in his life.
In this he refused to mourn the injustice that had deprived him of liberty and instead made his prison life useful. He showed exemplary conduct, humble deportment, faithfulness and kind interest that won the confidence of all in the prison. He continued to care for his suffering companions and to relieve the officers in their great distress of mind.