When ever these thoughts pop in recite sura naas or 7times
اعوذ بالله من الشيطان الرجيم.
The thoughts will go away. I have tried it and many youth have tried it. It works. It is a promise of Allah swt in the quran that if you recite it then Allah swt will protect you from the Shaytan.
Then if you can fast, do it. It will reduce the lust.
And God forbid if you slip again in the same lustful act after trying not to do so , then ask Almighty swt for forgiveness and tell Him you tried. He hears you and if you were trying your best then don’t worry He will forgive you.