We become righteous through Christ. It's in the Bible, II Corinthians 5:21, NIV. "God made Him who had no sin to be sin for us, so that in Him we might become the righteousness of God." Romans 3:22, NIV. "This righteousness from God comes through faith in Jesus Christ to all who believe."
Our righteousness is in the Lord. It's in the Bible, Isaiah 45:24, KJV. "In the Lord have I righteousness and strength."
We do not become righteous by being good. It's in the Bible, Isaiah 64:6, TLB. "We are all infected and impure with sin. When we put on our prized robes of righteousness, we find they are but filthy rags. Like autumn leaves we fade, wither and fall. And our sins, like the wind, sweep us away."
We are not righteous by nature, God makes us that way. It's in the Bible, Psalm 51:10, TLB. "Create in me a new, clean heart, O God, filled with clean thoughts and right desires."