Prophet Yusuf (Joseph)(AS) had been given the knowledge of interpretation of dreams. He had been sold as a slave to the minister of Egypt. When the minister’s wife accused him wrongly of misconduct, he was imprisoned even when he was found innocent.
“He said:’O my Lord! Prison is dearer to me than that to which they invite me.(Invitation to establish illicit relations). Unless You turn away their plot from me, I will feel inlined towards them and be one (of those who commit sin and deserve blame or those who do deeds) of the ignorant.”
(Yusuf 12: verse 33)
He being a pious and patient prophet used this time in ibadah and preaching Allah’s message. Once two more young men were imprisoned. It is said they saw a dream on the same night. They had seen Yusuf praying and preaching and had found him to be a learned man, so they went to seek his help in the interpretation of the dream.
“And there entered with him two young men in the prison. One of them said:” Verily I saw myself (in a dream) pressing wine.’ The other said: ‘Verily I saw myself ( in a dream) carrying bread on my head and birds were eating thereof.’ (They said):’ Inform us of the interpretation of this. Verily, we think you are one of the Muhsineen.(doer of good).”
(Yusuf 12: verse 36)
“He said:’ No food will come to you as your provision, but I will inform its interpretation before it (food) comes.[ that I will tell you so soon the real meaning of your dream before your food arrives].This is of what the Lord has taught me. Verily, I have abandoned the religion of a people that believe not in Allah and are disbelievers in the Hereafter. And I have followed the religion of my fathers—Ibraheem(great grandfather), Ishaq (grand father) and Yaqoob(father), and never could we attribute any partners whatsoever to Allah. This is from the Grace of Allah to us and to the mankind, but most men thank not( that they do not believe in Allah nor worship Him). “
“O two companions of the prison! as for one of you, he ( as a servant) will pour wine for his lord (king ) to drink; and as for other, he will be crucified and birds will eat from his head. Thus is the case judged concerning which you both did inquire.”
And it happened just as Yusuf had predicted. One was released and reinstated as a royal servant while the other was crucified.