The Ten Commandments are God's moral law. This law was given to show people how sinful they are. Paul says that the Law is our schoolmaster to bring us to Christ. Once a person has come to full trust in the finished work of Christ on the cross, the Law has done its work and has been fulfilled. Observing the Law does not save us because none of us can observe it because of our sinfulness. We are saved by grace through faith in Christ.
But we all will be judged from the great white throne according to God's moral law, because God is a God of justice as well as love. We will all be found guilty because "all have sinned and come short of the glory of God". But those who have placed their trust in Christ through faith will have had the penalty for their sin placed on Christ and will not have to bear it themselves, so they will be set free from having to be sentenced to God's eternal prison without parole.
But if we try to be saved by observance to the law, we will be judged by the same law we try to keep and will be found guilty, and Christ will say, "You trusted in your ability to keep the law instead of fully trusting in Me and My finished work on Calvary, so you will have to bear the eternal penalty for not keeping the law, and I regretfully cannot help you, and so you will have to go into the everlasting prison without the possibility of parole".
So, if you are trusting in your ability to keep the Ten Commandments in order to be saved, then you are in terrible danger, like a man in a burning aircraft having to jump without a parachute, and thinking by flapping your arms you will land on the ground safely.