As someone who has made, with God’s grace, great progress in the battle to be chaste, I am praying for you :gopray2:
Of course, like an addict or cancer sufferer, I would hesitate to say the battle is over.
One thing that helps is to simply switch off the tv and most other secular media, for the most part. Even the news sometimes focuses too much on the lovelives of celebrities, which can give rise to the thought that ‘everyone’s doing it’. They’re not, and if they are they shouldn’t be!
Try to be aware of the situations that tempt you and avoid them as much as possible, or arm yourself with prayer beforehand, during and after.
And very frequent (weekly or more than weekly if necessary and if it’s available to you) confession, and Mass as many days as you can attend.