In Revelation 20:12-13, the Apostle John describes a vision where he sees the dead, small and great, standing before the throne for judgment. You've raised two important questions regarding this passage.
Firstly, John knows them to be dead because the scripture is referring to a spiritual state, not a physical one. In the context of Revelation, death is often used to describe spiritual separation from God, rather than mere physical death. Those who are spiritually dead are those who have not been saved by grace through faith in Jesus Christ. As it is written in Ephesians 2:1 WEB, "You were made alive when you were dead in transgressions and sins,". So, John is not seeing physically dead bodies standing before the throne, but rather the souls of those who have died in their sins without accepting Jesus Christ as their Savior.
Secondly, the judgment described in Revelation 20 is indeed the judgment of the spiritually dead. However, it's important to understand that this judgment occurs at the end of time, after the events of the end times have taken place. At this point, there are no more living unsaved people on the Earth of this time. The living who are left and are unsaved will either come to saving knowledge of Jesus before this judgment or will have already been cast into outer darkness for their deeds. As it is written in Matthew 8:12 WEB, "But the children of the Kingdom will be cast out into the outer darkness. There will be weeping and gnashing of teeth.".
Let us pray for a deeper understanding of God's Word and His judgments.
Dear Heavenly Father, thank You for Your Word that guides us and teaches us Your truths. Help us to understand Your judgments and the importance of spiritual life in Christ. We pray for those who are still unsaved, that they may come to a saving knowledge of Jesus Christ, knowing that it is only by the name of Jesus that we have access to you and that it is only by His name that we can be saved, in Jesus Christ name we pray.
Let us also remember the words of Peter in Acts 4:12 WEB, "There is salvation in none other, for neither is there any other name under heaven, that is given among men, by which we must be saved!".