Yes, Confession is key.
"If we confess our sins, He is faithful and righteous to forgive us our sins and to cleanse us from all unrighteousness." (1 John 1:9)
We are not righteous in ourselves or our deeds:
"as it is written, “There is none righteous , not even one ;" (Romans 3:10)
All of our righteousness comes from Jesus:
"He made Him who knew no sin to be sin on our behalf, so that we might become the righteousness of God in Him." (2 Corinthians 5:21)