You stop sinning by turning to Jesus. While you are walking with Jesus, it’s impossible to sin. Jesus also forgives the sins you’ve committed. When you turn back away from Jesus, you inevitably will start sinning again.
How is this actually done, how does it actually work? Well, there’s this thing people have invented to bring you closer to the divine. It’s called prayer. While you are praying, you are in the safe embrace of Jesus. It’s impossible to sin while praying. But you can’t pray all the time so what do you do when you’re not praying?
Remember the state of mind that praying puts you in. You might not be able to pray all the time, but that state of mind is accessible from anywhere. Simply recall that state, and you’re, literally, walking again with Jesus. You’ll forget eventually, but that’s what a practice of regular prayer does for you, it makes you remember that there’s this place you can go anytime, anywhere, in your head, where you can be with Jesus.
Tell Jesus everything, and He’ll forgive you and cleanse you. Keep Jesus in mind, and with luck, you’ll never need forgiving again.