A QUESTION --AND AN ANSWER ...
QUESTION:. " how can salvation be freely given of God's grace and yet disobeying a commandment keep you from God and heaven?
1. Salvation is NOT freely given of God's grace to individuals.
The free gift is to mankind - the gift is Jesus by whom those who are called have the opportunity for salvation through justification by faith.
Rom 5:18 Therefore as by the offence of one judgment came upon all men to condemnation; even so by the righteousness of one the free gift came upon all men unto justification of life.
Rom 5:15 But not as the offence, so also is the free gift. For if through the offence of one many be dead, much more the grace of God, and the gift by grace, which is by one man, Jesus Christ, hath abounded unto many.
2. Individual salvation is a process. God calls some - then tests them. Those who keep His commandments are those who love Him. They pass the testing of their faith and receive eternal life.
Jas 1:12 Blessed is the man who remains steadfast under trial, for when he has stood the test he will receive the crown of life, which God has promised to those who love him.
That is why disobeying will keep you from God and heaven.
Modern Christianity eliminates the necessity of testing.
NOTE: Read more about the testing of your faith at this free link:
DECEPTION #6 I CAN FAIL THE TEST
The Seven Deadly Deceptions Of Counterfeit Christianity