"Indeed the faithful, the Jews, the Christians and the Sabaeans—those of them who have faith in Allah and the Last Day and act righteously—they shall have their reward from their Lord, and they will have no fear, nor will they grieve." - Qur'an 2:62
It means that all believers in the messages from Allah which were sent to people through prophets, who believed in Allah and the Hereafter and did good deeds, they will get their reward from their Lord and will have no fear in them nor will they grieve.
This means whose believers of the previous prophets during the time of those messages. No believer in any previous prophet can deny the prophet hood of the Last Prophet Muhammad (SAWA) because denying this final prophet means not believing in the previous messages of the prophets.