Paul makes it very clear in Ephesians 2:8-9 that salvation can never be earned or achieved by our own efforts. Even works of righteousness are insufficient. One can be a good, moral person and still be lost. One can do all kinds of good deeds, even religious deeds, and still not make it to Heaven.
Paul says, “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.” Salvation is according to God’s mercy, or to say it another way, one can only be saved by accepting the Lord Jesus, who was given through God’s mercy.