2 Corinthians 5:21 says “For He made Him who knew no sin to be sin for us, that we might become the righteousness of God in Him.” Jesus actually BECAME SIN FOR US so that we might become the RIGHTEOUSNESS OF GOD IN HIM!
When Jesus was on the cross He became the scapegoat for all of humanity - for you, for me - for all of our sins for all time! When Jesus died, He became everything that you are that you don’t want to be. He became sin. He became sickness. His thoughts became cursed (the crown of thorns represents this) - so that we can then have the mind of Christ. Everything that He was is everything that you become when you behold Him as crucified on your behalf. It’s the great exchange. He became sin who knew no sin that we might become the righteousness of God in Him.
When Jesus raised to life, He was raised BECAUSE OF our justification (see Romans 4:25). We were IN HIM when He was raised. We were in Him when He died and we were in Him when He was raised. Being that you died with Him (Col. 2:20) you were also raised with Him (Col. 3:1)!