See: Romans 3:20-27 (TLB)
“20 Now do you see it? No one can ever be made right in God’s sight by doing what the law commands. For the more we know of God’s laws, the clearer it becomes that we aren’t obeying them; his laws serve only to make us see that we are sinners.
“21-22 But now God has shown us a different way to heaven —not by “being good enough” and trying to keep his laws, but by a new way (though not new, really, for the Scriptures told about it long ago). Now God says he will accept and acquit us—declare us “not guilty”—if we trust Jesus Christ to take away our sins. And we all can be saved in this same way, by coming to Christ, no matter who we are or what we have been like. 23 Yes, all have sinned; all fall short of God’s glorious ideal; 24 yet now God declares us “not guilty” of offending him if we trust in Jesus Christ, who in his kindness freely takes away our sins.
“25 For God sent Christ Jesus to take the punishment for our sins and to end all God’s anger against us. He used Christ’s blood and our faith as the means of saving us from his wrath. In this way he was being entirely fair, even though he did not punish those who sinned in former times. For he was looking forward to the time when Christ would come and take away those sins. 26 And now in these days also he can receive sinners in this same way because Jesus took away their sins.
“But isn’t this unfair for God to let criminals go free, and say that they are innocent? No, for he does it on the basis of their trust in Jesus who took away their sins.
“27 Then what can we boast about doing to earn our salvation? Nothing at all. Why? Because our acquittal is not based on our good deeds; it is based on what Christ has done and our faith in him.”