The Quran says that whoever seeks a religion other than Islam, it will not be accepted from them, and it also says that God does not punish any people until a messenger has come to them with a clear message. 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 mentions groups of Jews, Christians and Sabians who believe in God and the last day and do good, and states they have their reward.
The Prophet ﷺ taught that God's mercy outweighs His anger. So Muslims hope for mercy for everyone, invite people to Islam with kindness, and leave the final judgment to God. Muslims do believe that knowing the truth and rejecting it is a serious matter.