The Quran says that whoever seeks a religion other than Islam, it will not be accepted from them, and it also says that Allah does not punish any people until a messenger has come to them with a clear message. Many scholars explain that those who never received the message of Islam clearly, or received it in a distorted form, are tested on the Day of Judgment and judged justly. The Quran also says that Jews, Christians and Sabians who believe in Allah and the last day and do good have their reward with their Lord (2:62); scholars differ on whether this speaks of those who followed their prophets before Muhammad ﷺ was sent or also of people today.
The Prophet ﷺ taught that Allah's mercy outweighs His anger. So Muslims hope for mercy for everyone, invite people to Islam with kindness, and leave the final judgment to Allah. Muslims do believe that knowing the truth and rejecting it is a serious matter.