Romans 4 “4 Now to the one who works, wages are not credited as a gift but as an obligation. 5 However, to the one who does not work but trusts God who justifies the ungodly, their faith is credited as righteousness. … God will credit righteousness—for us who believe in him who raised Jesus our Lord from the dead. 25 He was delivered over to death for our sins and was raised to life for our justification.”
Nobody can earn salvation by their works because works result in condemnation.
But the sinner who trusts in Jesus is made righteous without any works.
Why is that?
It is because Jesus Christ did all the work.
He died for our sins and forgave us.
He rose from the dead to make us as righteous as God
(we are perfectly sinless by faith in Jesus)