“How can God judge someone for something that they didn’t do?”
The original answer is an attempt to explain what happens to a child who dies immediately after birth. The Bible never tells us this directly. Do they get saved even though they have never accepted Jesus? Do they go to Hell because they have never accepted Jesus? My reasoning is based primarily on God’s foreknowledge; God knows in advance how people are likely to turn out. Even we, as humans, know people we trust and people we don’t. That does not mean we know everything they will do in the future, but we know the nature of the things they will do. Added to this, after 6000 years of human history and billions of individual lives, it will be very clear, when all the books are opened (and all the videos are shown) where people belong, and what someone with a similar spirit would have done. God’s Judgement will be in accordance with His justice, His love, and His mercy, and also with the requirement that rebels cannot be allowed into Heaven to cause the same mess that we have on Earth. I also believe that Justice will not only be done, but be seen to be done. See also Question 6:
6 Do Men Understand Exactly how God Works?
No. The belief that they do is based on pride. Men have neither the perspective, the knowledge, nor the intelligence to know exactly how God works. Any attempt to tie God down to a few simple mechanisms is a futile endeavour, based on pride. We are not called upon to understand God, but merely to have Faith in him; that does not mean having Faith that He exists, as that is obvious from what has been made. It means having trust and confidence in what He does and will do.