They said, "Are you indeed Joseph?" He said, "I am Joseph, and this is my brother. Allāh has certainly favored us. Indeed, he who fears Allāh and is patient, then indeed, Allāh does not allow to be lost the reward of those who do good."
Yusuf reveals His True Identity to His Brothers and forgives Them
Allah says, when Yusuf's brothers told him about the afflictions and hardship, and shortages in food they suffered from in the aftermath of the drought that struck them, and he remembered his father's grief for losing his two children, he felt compassion, pity and mercy for his father and brothers. He felt this way, especially since he was enjoying kingship, authority and power, so he cried and revealed his true identity to them when he asked them,
أَإِنَّكَ لَأَنتَ يُوسُفُ (Are you really the Yusuf?). Then, Sayyidna Yusuf (علیہ السلام) said: ` Yes, I am Yusuf and this is my brother, Benyamin.' He supplemented his statement by adding the name of his brother so that they become certain about him. In addition to that, he also wanted them to become sure right then about the total success of their mission, that is, the two they had started to search for were there before them, both at the same time and place. Then, he said: قَدْ مَنَّ اللَّـهُ عَلَيْنَا ۖ إِنَّهُ مَن يَتَّقِ وَيَصْبِرْ فَإِنَّ اللَّـهَ لَا يُضِيعُ أَجْرَ الْمُحْسِنِين ، that is, ` Allah has been very kind to us [ that he first gave both of us two qualities, those of patience (Sabr) and the fear of Allah (Taqwa), qualities which are a key to success and a security shield against every hardship. Then He changed hardship into comfort, separation into union, and our paucity of wealth and recognition into its total abundance. ` Surely, whoever fears Allah [ and abstains from sins ] and observes patience [ while in distress ], then Allah does not waste the reward of the good-doers [ like these ].'
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 90–92
‘God does not waste the reward of those who do good, who are righteous and steadfast.’ This is the moral lesson and substance of the whole story of Joseph. Almighty God wanted to set a clear example showing that one who adopts the God-fearing way in his worldly dealings and who avoids the ways of impatience will ultimately achieve success with His help. Joseph’s story was made a tangible example of this reality. In Egypt, the first seven years of prosperity and the succeeding seven years of scarcity had both occurred at the instance of God. Had it been the will of God, He would have made all the years prosperous years. Similarly, the incidents of Joseph’s being pushed into the well and his coming out of it and reaching Egypt both occurred under the watchful eye of God. Had God so desired, He would have arranged for Joseph to acquire a position of authority in Egypt without making him pass through the stage of being abandoned in a dry well. But, if these extraordinary incidents had not occurred, then in this world of ‘cause and affect’ how could he have established the example of the fact that He helps those who place their trust in Him and adhere to the path of righteousness and patience? There are two types of incidents: one which has an element of fame attaching to it and the other, which has no such element. Both incidents may be similar in nature, but one becomes famous while the other one remains unknown. God’s succour of this same nature may also be received by any number of righteous people. But the special feature of God’s succour in the case of Joseph was that it had a legendary quality about it, and that is why it came to be so widely known and appreciated.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.