Peter.... Now you have asked the correct question...
This raises a difficult question that no single passage fully answers. Scripture describes the division between the two groups in several ways. John says that the person who believes has already passed from death to life and will not come into judgment (John 5:24).
Yet! Five verses later, he speaks of those who have done good rising to life and those who have done evil rising to judgment (John 5:29).
So, Peter, can you believe and have done evil... and missed that boat? John does not say???
In Matthew 25, the sheep and goats are divided according to how they treated the hungry, the stranger, the sick, and the prisoner. The sheep are surprised because they did not realize they had been serving Christ (Matthew 25:37-40).
Paul, meanwhile, speaks of “those who belong to Christ” being raised at his coming (1 Corinthians 15:23, ESV).
Do faith, good conduct, mercy, and belonging to Christ all describe the same dividing line? Or do they describe different aspects of judgment? No single passage fully explains the relationship. Let's not forget being written in the Book of life before the foundation of the world.
Mat 7:21 "Not everyone who says to Me, 'Lord, Lord,' will enter the kingdom of heaven, but he who does the will of My Father who is in heaven will enter. 22 "Many will say to Me on that day, 'Lord, Lord, did we not prophesy in Your name, and in Your name cast out demons, and in Your name perform many miracles?' 23 "And then I will declare to them, 'I never knew you; DEPART FROM ME, YOU WHO PRACTICE LAWLESSNESS.'
So Peter... tell me how you fit in Jesus' words above... Tell us all the great things you have done! Tell us how demons fear you! We await your greatness to show us the way before Jesus returns!
You see, Peter... anyone can make a post; some of us are better than others... but that doesn't make us right. So stop trying to be some supreme leader here on this site! Just know... You will have to give an account! So, Peter... on this forum, can you tell Jesus... Did I not prophesy in Your name on the forum, and in Your name cast out demons, like (Pierac) and in Your name perform many miracles for others to see and be humbled by my post?
Peter, could you be headed for these words....? I never knew you!
Now... I ask you... how you are saved?