Answer: Many people torture themselves about this question, mainly due to the (usually) well-meaning but completely inaccurate teaching of modern “Christianity.” The Bible actually explains the answer in wonderful—and comforting—detail.
Concerning all of those who have ever lived who did know and love the real Jesus Christ and who did live and obediently walk with Him in this life, the Bible says that when He returns to rule the earth they “shall all be changed” (1 Corinthians 15:51) so that they “shall be like Him” (1 John 3:2) and “shall reign with Him for a thousand years” (Revelation 20:6), beautifying the earth the way it should be and helping people live in peace—like we’ve always wanted the world to be.
But for those who have never had the chance to know Jesus Christ (again, the real Jesus, not the fake one—check out 2 Corinthians 11:4) and to choose either to follow Him or to reject Him, they are not lost forever! The Bible says that “the rest of the dead [these people who never had the chance to know Him] did not live again until the thousand years were finished” (Revelation 20:5). After the thousand years of restoring and beautifying the world, the Bible says that the rest of the dead, “small and great” (verse 12) are resurrected and that “books are opened” for them. Here, the Greek word for “books” is biblion—the word that became the English word “Bible”! The Bible (which is a collection of books; look at it for yourself!) will then be open for them in the same way it had previously been opened for others. That’s why the Bible also says that “another book was opened, which is the Book of Life” (v. 12, again)—so that new names can be written in it!
This “general resurrection” in which all who have died without a chance will get their chance is mentioned a surprising number of times in the Bible—yet no one seems to see it! (e.g., Ezekiel 37:1-13; Matthew 11:21-24; Luke 11:31-32; Matthew 12:32; et al.)
God really is fair! And just! And loving! And the plan of God for mankind is far, far greater than almost anyone gives Him credit for. The Bible says that!