After having given the prison inmates a comprehensive lesson in Tauheed, Prophet Yusuf (a.s) interpreted their dreams for them.
After all the efforts of the women to pressurize him to commit sin, everyone realized that they will not be successful.
After the wife of the Governor was found to be guilty of wanting to seduce Yusuf (a.s), the attempts to keep this matter private were unsuccessful and the story of this incident leaked from the palace.
After Prophet Yusuf (a.s) had successfully resisted the invitation to commit sin with the wife of the Governor, the story continues about how they were caught out and its ramifications. This is captured in Verses 25 to 29.
After becoming established in the house of the Governor of Egypt, Yusuf (a.s) matured into a young man, at which point the Quran says that he was taught some knowledge. Thus verse 22 says:
After having spent approximately 3 days alone in the well in the darkness of the desert, the next stage of Yusuf (a.s)’s experience starts when a caravan of travellers stop at the well to replenish their water supplies.
So when they took him [out] and agreed to put him into the bottom of the well… But We inspired to him, “You will surely inform them [someday] about this affair of theirs while they do not perceive [your identity].”
After the brothers of Prophet Yusuf (a.s) agreed to get “rid” of him, they had to find an excuse to get their father to allow Prophet Yusuf (a.s) to be alone with them so that they could do their evil act.
“Certainly in (the story of) Yusuf and his brothers there are signs for those who ask.”
When Yusuf said to his father, Oh my father, Indeed I have seen (in a dream), eleven stars and the sun and the moon; I saw them prostrating to me.”