Eph 2:8 For by grace are ye saved through faith; and that not of yourselves: it is the gift of God:
Eph 2:9 Not of works, lest any man should boast.
Salvation is now and has always been by grace through faith. When God gives a command by faith we believe and do his word. Our faith is made evident by our works. Our works do not save us our faith in Gods Word, his law or promise given by command, is shown by our actions. If we believe we do what He wants and not do what He, God commands us not to do. Disobedience is not doing what God commands but doing the opposite, which is not of faith, disbelieving God.
Gen 2:16 And the LORD God
commanded the man, saying, Of every tree of the garden thou mayest freely eat:
Gen 2:17 But of the tree of the knowledge of good and evil,
thou shalt not eat of it: for in the day that thou eatest thereof thou shalt surely die.
After disobedience came grace and mercy. God did not reward us according to our works but made provision or promise.
Gen 3:15 And I will put enmity between thee and the woman, and between thy seed and
her seed;
it shall bruise thy head, and thou shalt bruise his heel.
Gen 3:21 Unto Adam also and to his wife did the LORD God make coats of skins, and clothed them.
This is the first time we see the sign of atonement. The oral law was given to Adam & Eve. God instructed them that death must take place as the consequence of sin. This was the shadow the substance was going to be in Eves seed Jesus Christ. The fulfillment was future but to believeGod and demonstrate faith an animal sacrifice must be made year by year to atone for their sin. When Cain offered an offering different than what God commanded even though he offered his best it is not accepted. Not of works, not because we do good things or are good people, if it is not what God commanded it is not of faith. We cannot be saved by the will of the flesh.
Gen 4:3 And in process of time it came to pass, that Cain brought of the fruit of the ground an offering unto the LORD.
Heb 11:4 By faith Abel offered unto God a more excellent sacrifice than Cain, by which he obtained witness that he was righteous, God testifying of his gifts: and by it he being dead yet speaketh.
1Jn 3:12 Not as Cain, who was of that wicked one, and slew his brother. And wherefore slew he him? Because
his own works were evil, and his brother's righteous.
This Law of God does not change from the Old Testament/Covenant to the New. In the old covenant they looked forward to the promise in the new we look back to the fulfillment. Both are of FAITH in God and his provision. If in the old covenant they didn't have faith they wouldn't do what God commanded in the new people now are condemned not because there is not provision for sin but because of unbelief.
Mar 16:16 He that believeth and is baptized shall be saved; but he that believeth not shall be damned.
Mar 16:17 And these signs shall follow them that believe; In my name shall they cast out devils; they shall speak with new tongues;