Some people say that anyone can go to Heaven by obeying or following the 10 commandments. There are several issues with this belief, including the fact that there are more than 10 commandments.
The 10 commandments are part of the law of Moses. According to an old Jewish count there are 613 commandments in the law of Moses, consisting of 248 do’s and 365 do not’s. While 613 may not be the exact number of commandments in the law, it is a far cry from 10 and is closer to reality.
Nobody can keep God’s commandments perfectly. Hypothetically speaking, if someone were to follow the law perfectly, they would not be justified in the eyes of the Lord. Galatians 3:11,12 says, “But that no man is justified by the law in the sight of God, it is evident: for, The just shall live by faith. And the law is not of faith: but, The man that doeth them shall live in them.”
Another Scripture is Galatians 2:16,21 “Knowing that a man is not justified by the works of the law, but by the faith of Jesus Christ, even we have believed in Jesus Christ, that we might be justified by the faith of Christ, and not by the works of the law: for by the works of the law shall no flesh be justified. … I do not frustrate the grace of God: for if righteousness come by the law, then Christ is dead in vain.” (See also, James 2:10.)
In conclusion, the famous 10 commandments are only 10 of the some 613 commandments in the law of Moses. And the Scriptures make it clear that nobody can go to Heaven by obeying or observing the commandments. A certain apostle said by the Holy Ghost that salvation is by grace through faith, not of works, nor by the deeds of the law (see, Romans 3:19–29; Ephesians 2:8,9; see also, Romans 10:5–14).
Reference:
Talmud. “Makkot 23b.”