Righteousness (Gr. dikaiosune) is a very major subject in the Bible, and it intersects with the doctrines of justification and sanctification.
In justification, 𝗿𝗶𝗴𝗵𝘁𝗲𝗼𝘂𝘀𝗻𝗲𝘀𝘀 𝗶𝘀 𝗮 𝗹𝗲𝗴𝗮𝗹 𝘀𝘁𝗮𝗻𝗱𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗚𝗼𝗱. He declares us righteous, not guilty, and forgiven. We are no longer condemned to be eternally punished in hell. This right standing before God is through the 𝗳𝗶𝗻𝗶𝘀𝗵𝗲𝗱 𝘄𝗼𝗿𝗸 𝗼𝗳 𝗝𝗲𝘀𝘂𝘀 𝗖𝗵𝗿𝗶𝘀𝘁, and is completely ours by faith. His righteousness, which is like a pure, clean robe that is put on us, is now legally ours. God sees us as sinless in Christ.
In sanctification, 𝗿𝗶𝗴𝗵𝘁𝗲𝗼𝘂𝘀𝗻𝗲𝘀𝘀 𝗶𝘀 𝗚𝗼𝗱’𝘀 𝘁𝗿𝗮𝗻𝘀𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻 𝗼𝗳 𝗼𝘂𝗿 𝗯𝗲𝗵𝗮𝘃𝗶𝗼𝘂𝗿 𝗶𝗻 𝗮𝗰𝗰𝗼𝗿𝗱𝗮𝗻𝗰𝗲 𝘄𝗶𝘁𝗵 𝗛𝗶𝘀 𝗼𝘄𝗻 𝗻𝗮𝘁𝘂𝗿𝗲, 𝘄𝗶𝗹𝗹 𝗮𝗻𝗱 𝗺𝗼𝗿𝗮𝗹 𝗹𝗮𝘄. The Holy Spirit transforms us so that our behaviour reflects God’s nature (His love, His truth, His holiness), and we live a life which is in line with God’s will and His moral law (the Ten Commandments). This moral transformation is the 𝘄𝗼𝗿𝗸 𝗼𝗳 𝘁𝗵𝗲 𝗛𝗼𝗹𝘆 𝗦𝗽𝗶𝗿𝗶𝘁. We actually sin less and less in life.
As a child of God, we need both kinds of righteousness!