It's certainly an important question. If Jesus really is the only way to God,then we need to have an answer to this, both for our own sanity and for people who genuinely see it as a problem.
He will punish those who do not know God and do not obey the gospel of our Lord Jesus. They will be punished with everlasting punishment and shut out from the presence of the Lord..."
Another useful verse on this topic is Deuteronomy 29:29:
"The secret things belong to the Lord our God, but the things revealed belong to us and to our children forever, that we may follow all the words of this law.