The bible teaches us that God created humans for eternal life with good works, which He had prepared beforehand so that we would walk in them. (Ephesians 2:10) In Hebrew, the foundation of good works is mitzvot (laws of God). God also created humans to be holy and blameless before Him. (Ephesians 1:4) The wages of the righteous is life. (Proverbs 10:16, Romans 6:23) He who is steadfast in righteousness will attain life. (Proverbs 11:19) In other words, in the way of righteousness is life, and in its pathway, there is no death. (Proverbs 12:28) Therefore, the requirement for life for Adam and Eve was for them to be righteous, holy, and blameless before God. God wanted Adam and Eve to have life through righteous works. Life was not free for them, so it cannot be free for anyone else.
Adam and Eve hoped they would have eternal life from good works. The Lord had promised them life. (Titus 1:2) They understood four things their children today need to understand. First, there is sin leading to death and sin not leading to death. Second, if anyone sees his brother sinning not unto death, they shall ask, and God will for them give life to those who sin not unto death. Third, all unrighteousness is sin. (1 John 5:16-17) Fourth, the way of the Lord is doing righteousness. (Genesis 18:19) Therefore, in the way of righteousness is life, and in its pathway, there is no death. (Proverbs 12:28) The Bible shows that the Ten Commandments, and laws, and requirements of God predate sin. (Deuteronomy 4:13, Psalm 119:1, Psalm 119:80, Proverbs 28:18, Ezekiel 28:15, Luke 1:6, 2 Peter 2:21)
After Sin from Adam to Moses
After sin, by faith, we could get eternal life with good works. An important fact needs to be understood at this point. That fact is that there is not a righteous person on earth who continually does good works and who never sins. (Ecclesiastes 7:20) Therefore, 100% obedience to the Lord is not needed for life. Being righteous and holy and blameless before God simply means not being worthy of death. Consider the following three scriptures. (1) If someone sins worthy of death, they are put to death. (Deuteronomy 21:22) (2) There may be no sin in the person worthy of death. (Deuteronomy 22:26) (3) Those who practice such things are worthy of death. (Romans 1:28-32) Remember the wages of sin is eternal death; likewise, the wages of the righteous is life. (Proverbs 10:16, Romans 6:23)
From Adam to Moses, people receive eternal life through good works. Christ says, “I say to you that many will come from east and west, and recline at the table with Abraham, Isaac, and Jacob in the kingdom of heaven.” (Matthew 8:11) Moreover, He says, “In that place, there will be weeping and gnashing of teeth when you see Abraham and Isaac and Jacob and all the prophets in the kingdom of Heaven, but yourselves being thrown out.” (Luke 13:28) Do you not know that the unrighteous cannot inherit the kingdom of Heaven? Do not be deceived; neither fornicators, nor idolaters, nor adulterers, nor effeminate, nor homosexuals, nor thieves, nor the covetous, nor drunkards, nor revilers, nor swindlers, will inherit the kingdom of Heaven. (1 Corinthians 6:9-10) Therefore, people were able to earn life with righteous works from Adam to Moses.
Under the Old Covenant
Under Moses, the ability to win eternal life by good works continued. God gave good laws that lead to life. (Leviticus 18:4-5; Deuteronomy 30:6-20; Nehemiah 9:29; Proverbs 4:1-9; Proverbs 7:1-3; Ezekiel 3, 18, 20, 33) Ezekiel 18:27-28 even says that if you follow the way of righteousness you will save your life; you shall surely live; you shall not die. Therefore, the requirements for everlasting life are present under the Old Covenant. God also gave some laws that were not good for everlasting life. (Ezekiel 20:25) These not good laws are contained in the book of the law, commonly called the Law. The not good laws were added because of transgressions under the Old Covenant, until the seed would come to whom the promise had been made. (Galatians 3:19) In other words, the Law was a penal code.
Not good laws could not achieve everlasting life of good works. These laws were a tutor to lead people to Christ. However, since Christ has come, we are no longer under a tutor. (Galatians 3:23-25) They were weak and useless. (Hebrews 7:18) They related only to food and drink and various washings, and regulations for the body imposed until a time of reformation. (Hebrews 9:9-10) Therefore, we have been released from the Law. (Romans 7:6) Christ freed us from the law of sin and of death. (Romans 8:2) He canceled out the certificate of debt consisting of decrees against us, which was hostile to us; and took it out of the way, having nailed it to the cross. (Colossians 2:14) The Apostle Paul’s negative comments about the Law are about the penal code in the book of the law.
Under the New Covenant
Under grace the ability to gain everlasting life from good works continues. We know this because God does not change. (Malachi 3:6) Also, He does not change His spoken words. (Psalm 89:34) Also, He does not change His counsel for humans. (Hebrews 6:17) Moreover, He does not change His calling for humans. (Romans 11:29) Are we not called to be holy and blameless before God? (Ephesians 1:4) For those who disagree, let us look at some of the Old Testament precepts continued in the New Testament.
Being blameless is how we inherit everlasting life with good works. Those who endure to the end will be saved. (Matthew 10:22, 24:13, Mark 13:13) Work for the food, which endures to everlasting. (John 6:27) They know the ordinance of God that those who practice such things are worthy of death. (Romans 1:32) The doers of the requirements of the Law will be justified. (Romans 2:13) Those who practice such things will not inherit the kingdom of God. (Galatians 5:21) God chose us from the beginning to be holy and blameless. (Ephesians 1:4) We were created for good works, which God prepared beforehand for us to walk in them. (Ephesians 2:10) Walk in a manner worthy of the Lord, bearing fruit in all good works. (Colossians 1:10) God will give everlasting to those who sin not leading to death. (1 John 5:16)
Doing righteousness is how we realize eternal life through good works. Do not go on presenting the members of your body to sin as instruments of unrighteousness but present yourselves to God as those alive from the dead and your members as instruments of righteousness to the Lord. (Romans 6:13) When freed from sin, become slaves of righteousness. (Romans 6:18) Present your members as slaves to righteousness, resulting in sanctification. (Romans 6:19) Pursue righteousness, godliness, faith, love, perseverance, and gentleness. (1 Timothy 6:11) Pursue righteousness, faith, love, and peace. (2 Timothy 2:22) Live sensibly, righteously and godly in the present age. (Titus 2:11-12) Die to sin and live to righteousness. (1 Peter 2:24)
Doing the will of God is how we earn eternal life by good works. Those who do the will of the Lord who is in heaven will enter. (Matthew 7:21-23) You need endurance, so that when you have done the will of the Lord, you may receive the promise of everlasting. (Hebrews 10:36) Live the rest of your time in the flesh for the will of the Lord. (1 Peter 4:2) Those who suffer according to the will of God entrust their souls to Him by doing what is right. (1 Peter 4:19) The will of God is that humans do what is right in His sight. (1 Peter 2:15) Whoever does the will of the Lord will live forever. Everyone who practices righteousness is born of God. (1 John 2:17, 29)
Sinning is not how we accomplish eternal life of good works. A person is justified by good works and not by faith alone. (James 2:24) Everyone who practices sin also practices lawlessness, and sin is lawlessness. Whoever practices righteousness is righteous, just as the Lord is righteous. The one who practices sin is of the devil. (1 John 3:4, 7-8) Whoever is born of God does not practice sin. No one who does not practice righteousness is of the Lord. (1 John 3:9-10) Let the one who is righteous, still practice righteousness; and the one who is holy, still keep themselves holy.” (Revelation 22:11)
The question is do we still obtain eternal life from good works under the New Covenant. Christ said that if someone wants to enter into everlasting they should follow the way of righteousness. (Matthew 19:17, Luke 10:25) In other words, the conclusion, when all has been heard, is fear God and keep the way of righteousness, because this applies to every person. (Ecclesiastes 12:13)