Allah consoles His Prophet Muhammad ﷺ for the disbelief of his people and gives him the glad tidings of good consequences and victory in this world and the Hereafter, as happened to Musa bin `Imran, peace be upon him, whom Allah sent with clear proof and definitive evidence. Allah says:
بِـَايَـتِنَا وَسُلْطَانٍ مُّبِينٍ
(with Our Ayat, and a manifest authority). Authority means proof and evidence.
إِلَى فِرْعَوْنَ
(to Fir`awn), who was the king of the Copts of Egypt.
وَهَـمَـنَ
(Haman) who was his adviser.
وَقَـشرُونَ
(and Qarun) who was the richest trader among the people of his time.
Frequent references were made earlier in the text to the warnings given to deniers of pure monotheism and prophethood which brought more opposition and hostility from disbelievers. Naturally, this situation made the Holy Prophet ﷺ sad. It was to comfort him that, in nearly two sections cited above, mentioned there is the story of Sayyidna Musa (علیہ السلام) and Pharaoh. In this story, there is a lengthy dialogue between the Pharaoh, his people and a righteous elder who, despite being a scion of the House of the Pharaoh, had believed in the faith of Sayyidna Musa (علیہ السلام) after having seen the miracles shown at his hands - but, had kept his faith secret until that time. Once this dialogue took place, his faith stood declared automatically and conclusively.
Out of early Tafsir authorities, Muqatil, Suddiyy and Hasan have said that he was a cousin of the Pharaoh and was the same person who, at the time they were talking in the court of Pharaoh about killing Sayyidna Musa (علیہ السلام) in retaliation against the killing of the Copt, had come running from the far side of the city and apprised Sayyidna Musa (علیہ السلام) of the danger and advised him to go out of Egypt. This event has been mentioned in Surah Al-Qasas: وَجَاءَ رَجُلٌ مِّنْ أَقْصَى الْمَدِينَةِ يَسْعَىٰ (And there came a man running, from the farthest part of the city. - A1-Qasas, 28:20)
The name of this believing member of the House of the Pharaoh has been given as Habib in some sources. But, the truth of the matter is that Habib is the name of the person who has been mentioned in Surah Sin (36:20). The name of this person is شَمعان (Shama'n). Suhaili considers this name as most correct. Others say that his name is Hizgil. Tha'labi has reported the same name from Sayyidna Ibn ` Abbas ؓ .
In a Hadith, the Holy Prophet ﷺ said, 'Of some صِّدِّيقِين (siddiqin: the truthful ones), there is Habib najjar (carpenter) whose incident appears in Surah Ya Sin; the other is the believer from the House of Pharaoh; the third, Abu Bakr (Sayyidna Abu Bakr as۔ ؓ ), and he is the foremost among them.' (Qurtubi)
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 22–24
In the history of the world it has happened frequently that one nation or community rises to great heights, but is then annihilated. One finds that a nation once gave birth to a grand civilization and today that civilization is traceable only through its half buried ruins. A nation which once enjoyed the position of a live entity is today considered worthy of mention only as a matter of historical record. Such events are a common occurence. But people have attributed them to geological phenomena or to historical revolutions. But the fact is that the fall of nations has always resulted from Divine decisions, which were imposed on the concerned peoples on account of their denial of the Truth. Had we possessed the insight to see the reality behind the events we will find that every event took place through the angels of God, though to all appearances, its causes were of a worldly nature.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.