(They are) refers to those who believe in the Unseen, establish the prayer, spend from what Allah has granted them, believe in what Allah has revealed to the Messenger and the Messengers before him, believe in the Hereafter with certainty, and prepare the necessary requirements for the Hereafter by performing good deeds and avoiding the prohibitions. Allah then said,
عَلَى هُدًى
(On guidance) meaning, they are (following) a light, guidance, and have insight from Allah,
وَأُوْلَـئِكَ هُمُ الْمُفْلِحُونَ
(And they are the successful) meaning, in this world and the Hereafter. They shall have what they seek and be saved from the evil that they tried to avoid. Therefore, they will have rewards, eternal life in Paradise, and safety from the torment that Allah has prepared for His enemies.
Ma'arif al-Qur'an
Mufti Muhammad ShafiOn ayahs 4–5
This verse speaks of some other attributes of the God-fearing, giving certain details about faith in the unseen with a special mention of faith in hereafter. Commenting on this verse, the blessed Companions ` Abdullah ibn Masud and ` Abdullah ibn ` Abbs ؓ have said that in the days of the Holy Prophet ﷺ God-fearing Muslims were of two kinds, - those who used to be associators and disbelievers but accepted Islam, and those who used to be among the people of the Book (that is, Jews and Christians) but embraced Islam later on; the preceding verse refers to the first group, and this verse to the second. Hence this verse specifically mentions belief in the earlier Divine Books along with belief in the Holy Qur'an, for, according to the Hadith, people in the second group deserve a double recompense, firstly, for believing in and following the earlier Books before the Holy Qur'an came to replace them, and secondly, for believing in and following the Holy Qur'an when it came as the final Book of Allah. Even today it is obligatory for every Muslim to believe in the earlier Divine Books except that now the belief has to take this form: everything that Allah has revealed in the earlier Books is true (excepting the changes and distortions introduced by selfish people), and that it was incumbent upon the people for whom those Books had been sent to act according to them, but now that all the earlier Books and Shari'ahs have been abrogated, one must act according to the Holy Qur'an alone.3
There is no doubt that the Quran is a book of guidance. But it guides only those who are sincere in their search for truth, and who are anxious to be guided. The search for truth is inherent in man’s nature; one has simply to uncover one’s own true nature in order to find it. True searching and true finding are but the initial and the advanced stages of the same journey. One who searches for truth unravels the closed faculties of his own inner self. Thus with God’s help, the vague yearnings of his nature begin to receive a definite response. The awakening within one of these sincere yearnings is an attempt to discern the world of meanings (the hidden world) behind the world of forms (the present world). When this leads to a discovery, it is transformed into faith in the unseen. That which is initially an urge to submit to some superior power, later takes on the form of bowing to the Almighty. That which is initially a wish to sacrifice oneself for some greater good, later takes the form of spending one’s wealth for the cause of God. That which is initially a quest to comprehend the final outcome of life beyond this world, finds an answer in the form of faith in the life to come. To discover truth is to raise one’s consciousness to the level of the supreme reality. Those who find truth in this way become complex-free souls. They come to see truth as it really is. Wherever truth is, and whoever proclaims it, they immediately recognize and accept it. No rigidity, convention or prejudice, can come between them and the truth. God gives His protection to people having this nature. His universal order embraces them, so that they may be guided on a sure course in this world. Heaven will be their final destination in the life to come. Only those who seek truth can find it. Those who seek it shall surely find it. On this path, there is no divide between seeking and finding.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.