Doing good works, i.e., following the Law, is not a monopoly of God-fearing people. Rom.2:4 “Even Gentiles, who do not have God’s written law, show that they know his law when they instinctively obey it, even without having heard it.”(NLT). Even people from godless societies, like atheists, do good to their neighbors. Goes to show that good works can be done by anyone, if they so choose.
But, even our ultimate good works and what maybe the very best to us may not necessarily be so, as far as God is concerned. Notice how the prophet Isaiah included himself in:
“All of us have become like one who is unclean, and all our righteous acts are like filthy rags; we all shrivel up like a leaf, and like the wind our sins sweep us away” (Isaiah 64:6). The word filthy is from Hebrew word iddah, which literally means “the bodily fluids from a woman’s menstrual cycle.”
It is God who defines what is good and pleasing to him. In the narrative offering of Esau and Cain:
“And in process of time it came to pass, that Cain brought of the fruit of the ground an offering unto Jehovah. And Abel, he also brought of the firstlings of his flock and of the fat thereof. And Jehovah had respect unto Abel and to his offering: but unto Cain and to his offering he had not respect. And Cain was very wroth, and his countenance fell” (Gen. 4:3-5).
“By faith Abel offered unto God a more excellent sacrifice than Cain, through which he had witness borne to him that he was righteous, God bearing witness in respect of his gifts: and through it he being dead yet speaketh” (Heb.11:4).
Notice that both gave an offering but Abel was by faith, and Cain was not. His offering was rejected because it was offered according to his own presumption of what is best for him that is acceptable and pleasing to God. The “fruit” that he sacrificed for, turned out to be as “filthy rags” because it was not by faith. This narrative suggesting the “righteousness of faith” and not of works.
Similarly, the narrative in Genesis about Adam to become like YHVH,(to be His body/church) had to come not from Adam’s work by himself eating the forbidden fruit. That “oneness with YHVH” can only be achieved, not through man-Adam but through the faith and work of the second-Adam, the man-Jesus.
In summary, good works, i.e., righteousness, is defined by and has to come from God. In fact, the fruits of the Spirit require that they had to come from the in-dwelling of the Holy Spirit in us. We could not receive this promise of the Holy Spirit unless by grace and faith, through the death and resurrection of Christ. In Eph. 2:10 and 2 Cor. 3:5, the expression of these fruits of the. Holy Spirit as in “we are his workmanship, created in Christ Jesus for good works, which God prepared beforehand, that we should walk in them”.
There is only one way for anyone to be saved, and that is through the sacrifice of one person, the Creator YHVH, who incarnated to Christ Jesus, as in “There is salvation in no one else! God has given no other name under heaven by which we must be saved.” (Acts 4:12)