All the dead will appear before the great white throne of judgment, standing there in their resurrection bodies - Revelation 20:11-15. Verse 13 states that "they were judged every man according to his works."
Yet earlier on the Bible shows that all who had died "in Christ" had their new resurrection bodies raised from their graves to ascend up to Christ. After them, all the living saints on earth were then 'caught up' to follow them (1 Thessalonians 4:13-18).
This agrees with Revelation 14:13-16 where the first "reaping" of the harvest at the end of the world takes place, those who belong to Christ being gathered. Then immediately comes the second "reaping" - of the vine of the earth, so that its clusters be thrown into the winepress of the wrath of God" (14:17-20).
This indicates the removal from the grave, and from the earth, of all who belong to Christ, before the judgment begins. No wonder Jesus asked, "When the Son of Man comes, will he really find faith on the earth?" (Luke 18:8) No, he won't, because all those with saving faith will have been "reaped" and gathered up and away before the judgment begins.
Yet it is true that "all must appear before the judgment seat of Christ"(2 Cor. 5:10). The question is, will they be judged as will be those without saving faith? To appear is not necessarily to stand in the dock, accused! That's what happens to all the faithless, those who did not put faith in what Christ did to remove the charge of sin.
That is why Jesus promised his own that they would "not come into judgment" (John 5:24). They have already been cleared of the charges of the accuser of the brethren. They have no case to answer. Yet they do have their lives examined for there are books opened on that day - those containing the deeds of everyone, and "The Book of Life" with all the names of those who have passed over from judgment to life. According to the books containing everyone's deeds, they will either not have their names in The Book of Life, or they will. Those who do are given their due reward for how they lived in the flesh, on earth. Those rewards will vary. This agrees with what Jesus said in Matthew 16:27 -
"For the Son of Man shall come in the glory of his Father with his
angels; and the he shall reward every man according to his works."
That does not contradict the reward for those not having their names in The Book of Life being a casting into the eternally burning sulphuric lake of fire. But for those who passed over from death and judgment to life, they are rewarded in heaven according to how they lived on earth. Please note that salvation is not a reward. It is an unmerited gift, freely bestowed on those with saving faith in Christ. All their sins are wiped away and thereafter, their lives will result in either greater or lesser rewards in heaven.
This question can only be answered by taking all that the Bible says about that day of Resurrection and Judgment, to get the full picture. I have only mentioned a few related texts. Others are Matthew 5:12 & vs.21, 1 Corinthians 3:8, 2 John vs.8, Rev.22:12, James 2:13, Romans 5:18-21 and there are many more. This really is a topic that you have raised, which requires a broad knowledge of all that the Bible says on the subject. This answer may point you in the right direction, for the two texts you mention are not contradictory and once that is seen, then the question you ask cannot arise.