Can One earn Salvation?
Can one earn salvation by being a so-called good person or for doing something for it, say good works? The answer is No---Salvation is only by God's grace and through His Son Jesus Christ---there is no other way. But don't take my word for it. Lets see what God's word says.
Being Good?
But we are all as an unclean thing, and all our righteousnesses are as filthy rags; and we all do fade as a leaf; and our iniquities, like the wind, have taken us away. Isaiah 64:6
Romans 3:10-12 As it is written, There is none righteous, no, not one: There is none that understandeth, there is none that seeketh after God. They are all gone out of the way, they are together become unprofitable; there is none that doeth good, no, not one.
Romans 3:23 For all have sinned, and come short of the glory of God...
Romans 7:18 For I know that in me (that is, in my flesh,) dwelleth no good thing...
So you see there is nothing good in a person-- being apart from Christ. Because we have all sinned and come short of the glory of God. And all of the so-call good works that one could ever do, will never save them from being condemned. Because it's only by God's grace and faith in His Son Jesus Christ, that one can be saved from being condemned. And it's a gift from God: not by works, lest any man should boast.
Ephesians 2:8-9 For by grace are ye saved through faith; and that not of yourselves: it is the gift of God: Not of works, lest any man should boast.
Romans 6:23 For the wages of sin is death; but the gift of God is eternal life through Jesus Christ our Lord.
Romans 5:16-17 And not as it was by Adam that sinned, so is the gift: for the judgment was by one to condemnation, but the free gift is of many offences unto justification. For if by one man's (Adam) offence death reigned by one; much more they which receive abundance of grace and of the gift of righteousness shall reign in life by one, Jesus Christ.
So no one is good enough or can do anything good enough to be saved. It's only by God's grace and by the power of His Holy Spirit, that gives a person faith enough to believe on His Son Jesus Christ, so that they can be saved, and not be condemned.
John 3:18 He that believeth on him is not condemned: but he that believeth not is condemned already, because he hath not believed in the name of the only begotten Son of God.