We unrighteous people cannot produce the necessary righteousness or impute it to others.
Job 14:4 Who can bring a clean thing out of an unclean? not one.
Jews and Gentiles both have preferred their own righteousness rather than the righteousness of God.
Romans 10:1 Brethren, my heart's desire and prayer to God for Israel is, that they might be saved. 2 For I bear them record that they have a zeal of God, but not according to knowledge. 3 For they being ignorant of God's righteousness, and going about to establish their own righteousness, have not submitted themselves unto the righteousness of God.
Romans 8:3 For what the law could not do, in that it was weak through the flesh, God sending his own Son in the likeness of sinful flesh, and for sin, condemned sin in the flesh: 4 That the righteousness of the law might be fulfilled in us, who walk not after the flesh, but after the Spirit.
Ephesians 2:8 For by grace are ye saved through faith; and that not of yourselves: it is the gift of God: 9 Not of works, lest any man should boast. 10 For we are his workmanship, created in Christ Jesus unto good works, which God hath before ordained that we should walk in them. 4:24 And that ye put on the new man, which after God is created in righteousness and true holiness.
God is the cause and salvation is the effect after which salvation is the cause and good works are the effect, never the other way around. If you need to, I encourage you to call on Him with this simple prayer: “Lord Jesus, come live in my heart, forgive my sin and put your righteousness into my heart and my life.”
Romans 10:13 For whosoever shall call upon the name of the Lord shall be saved.