Does this mean that you can earn your way into heaven by keeping the 10 commandments? No! That would be silly. It's like some street urchin expecting to be adopted into the Royal Family on the basis of never being in trouble with the police. It's merely a minimum expectation of behavior, nothing more.
Can you earn your way into hell by breaking the 10 commandments? Most assuredly.
The Law says: Do not murder. Jesus says: If you hate your brother it is the same as murder.
The Law says: you shall not commit adultery. Jesus says: if you look on a woman with lust, you have committed adultery.
Jesus said, in Mark 12:30, AND YOU SHALL LOVE THE LORD YOUR GOD WITH ALL YOUR HEART, AND WITH ALL YOUR SOUL, AND WITH ALL YOUR MIND, AND WITH ALL YOUR STRENGTH.’ 31”The second is this, ‘YOU SHALL LOVE YOUR NEIGHBOR AS YOURSELF.’ There is no other commandment greater than these.”
You don’t go to hell because you break the 10 commandments, you go to hell for not being Born Again.
I think that's what John 3:18 states; right?