And that doesn't seem to make sense. Because we are not righteous. On our best days, we're not perfect, and on our worst days we are sad sinners who don't even come close to perfection.
So is God just pretending?
Of course we know that Jesus died for our sins, even the ones we have yet to commit. We ought always, continually, to give thanks that He died so we could be forgiven. But how does that translate into "righteousness?" "Righteous" would mean not just "forgiven" but also "never sinned in the first place."
Here's how God maintains His justice and justifies us: Christ lived under God’s law and perfectly kept it in our place. But when the fullness
of time had come, God sent forth his Son, born of woman, born under the law, to
redeem those who were under the law, so that we might receive adoption as sons
(Galatians 4:4-5). It was our Savior’s obedience to the Law that enables
God to justify those who believe in Him. For as by the one man's disobedience the many were made
sinners, so by the one man's obedience the many will be made righteous. Romans
5:19
When we are “declared righteous” by
God, it is Christ's actual righteousness, based on His actual obedience to the Law. Here’s how Jerry Bridges explained it in The Discipline of Grace. (You could order a copy here.)
…the righteousness that is a gift from God is a real righteousness, worked out in a real world by a real person, the Lord Jesus Christ. It is nothing less that perfect conformity to the law of God over a period of thirty-three years by the Son of God who became a human being and lived a life of perfect obedience (p. 49).
He does not create some legal fiction, calling something righteous that is not. Rather, He declares us righteous on the basis of the real, accomplished righteousness of Jesus Christ, which is imputed or credited to us through faith (p. 50).
Among many wonderful things, this means that my standing with God is always based on Christ's performance, not mine. I may feel unworthy (I am), and my daily record of obedience is sometimes just pathetic. But God doesn't evaluate me on my record, but instead He has credited Jesus' record to me. What a Savior!