The Bible says very clearly that salvation cannot be earned through works. The apostle Paul writes, "For by grace you have been saved through faith, and that not of yourselves; it is the gift of God, not of works, lest anyone should boast" (Ephesians 2:8-9 Ephesians 2:8-9  For by grace are you saved through faith; and that not of yourselves: it is the gift of God:
 Not of works, lest any man should boast.
American King James Version×). Salvation is a free gift from God received after genuine repentance and baptism (Acts 2:38-40 Acts 2:38-40  Then Peter said to them, Repent, and be baptized every one of you in the name of Jesus Christ for the remission of sins, and you shall receive the gift of the Holy Ghost.  For the promise is to you, and to your children, and to all that are afar off, even as many as the LORD our God shall call.  And with many other words did he testify and exhort, saying, Save yourselves from this untoward generation.
American King James Version×).
However, salvation is something we are capable of losing. The author of Hebrews warns that it is possible to "neglect so great a salvation" (Hebrews 2:3 Hebrews 2:3How shall we escape, if we neglect so great salvation; which at the first began to be spoken by the Lord, and was confirmed to us by them that heard him;
American King James Version×) if we do not "give the more earnest heed to the things we have heard, lest we drift away" (Hebrews 2:1 Hebrews 2:1Therefore we ought to give the more earnest heed to the things which we have heard, lest at any time we should let them slip.
American King James Version×). So how do we avoid neglect and spiritual drift? We need to be zealous to follow God's way of life. This includes doing what Jesus Christ told the rich young ruler: "If you want to enter into life, keep the commandments" (Matthew 19:17 Matthew 19:17And he said to him, Why call you me good? there is none good but one, that is, God: but if you will enter into life, keep the commandments.
American King James Version×).
Why? Because the only way to be happy is to be like God, which He explains through His laws. His laws are good, and so He wants us to obey them for our good and for the good of those around us. We must recognize that God's law is so important to Him that our disobedience required Jesus Christ to die. This should lead us to choose and to strive to avoid sinning.
The Bible tells us that "all have sinned [broken God's law] and fall short of the glory of God" (Romans 3:23 Romans 3:23For all have sinned, and come short of the glory of God;
American King James Version×). The blood of Christ removes the death penalty from us each time we sin only when we truly repent. Repentance involves turning from sin and following God and His law.
Salvation, though it cannot be earned, can be lost if we don't stay on the narrow path to life (Matthew 7:13-14 Matthew 7:13-14  Enter you in at the strait gate: for wide is the gate, and broad is the way, that leads to destruction, and many there be which go in thereat:
 Because strait is the gate, and narrow is the way, which leads to life, and few there be that find it.
American King James Version×). Obedience to God's "perfect law of liberty" (James 1:25 James 1:25But whoever looks into the perfect law of liberty, and continues therein, he being not a forgetful hearer, but a doer of the work, this man shall be blessed in his deed.
American King James Version×) should be our natural response to Jesus' sacrifice and gift of forgiveness and salvation.
For more understanding, please read our Bible study aid booklet "The New Covenant: Does It Abolish God's Law?"