There is a wide-spread notion that one can go to heaven by keeping the law, especially the ten commandments. But the law was not given to any people who had heaven for their hope. It was given to Israel, God's earth people. They have their future on earth, not in heaven.
The law was not given to save, but to convict folks of sin. It is like a mirror. You look into it and see how bad you are. You can no more cleanse yourself by the law than you can cleanse your face with the mirror.
"Now we know that what things soever the law saith, it saith unto them who are under the law: that every mouth may be stopped, and all the world may become guilty before God" (Rom. 3:19). Note that this is for those under the law, not Gentiles, or even unbelievers. Why is not an unbeliever under the law? "The carnal mind is enmity against God; for it is not subject to the law of God, neither indeed can be" (Rom. 8:7).
The law was added to the promise because of the great transgression, the idol in the wilderness. But it was given by grace, for it was to convict people of their lack and to turn them to Christ. So the law was given that they might know sin, recognize it in themselves.
It can be of benefit to us today to read about this people, their failures, even under law, and the One Who came and fulfilled all the requirements of that law, so that they might turn to Him and be saved by grace. Moreover, the law could not give life, no one could be justified by its deeds, and it could not give righteousness. But Christ can do all this, and more. In the secret revealed to us today, we find that He can seat us with Him in His Father's throne till He is manifested in the heavenly places.
Again, we must note that the law could not give life, therefore, no resurrection. Death must be reckoned with. But there is a miracle in Rom. 2:14 which is even today found in the believer. One who believes and has the new nature, does by this new nature the things contained in the law. This might be news to many.
In Romans, the one baptism was known (6:3-5), and so they knew the blessed fact of being dead with Christ, buried with Him, and raised with Him to walk in newness of life. It was the goodness of God that brought them to repentance. The member of the church which is the body of Christ today enjoys a further identification with Christ; quickened, raised, and seated with Him in heavenly places. This identification is a far better incentive and more powerful than being under the law. So grace can bring about what the law cannot accomplish.
"For the grace of God that bringeth salvation, hath appeared to all men, teaching us that, denying ungodliness and worldly lusts, we should live soberly, righteously, and godly, in this present world" (Titus 2:11,12). Read the next verse.