Paul says in Romans 3:5, “But if our unrighteousness serves to show the righteousness of God, what shall we say? That God is unrighteous to inflict wrath on us? (I speak in a human way.” Our past sins can serve a purpose if we allow them too. We should never dwell on our past sins as a way to prevent us from moving forward, but instead we should let them drive us toward the Lord.
When Jesus went to the cross, He was taking on the sins of the world. We needed His forgiveness for every single sin that stained our lives. So He died for those sins. We do not need to dwell and remember those sins, but instead think about how He rescued you from those sins and gave you a new life. Our sins and unrighteous living shows how righteous the Lord really is.