Repeating Estighfaar is very helpful as well as repeating LA HAWLA WALA QOWWATA ELLA BILLAH.
When the believer remembers the fact of the grave which is our place for long period, and remembers the Paradise for the pious and Hellfire for wrongdoers, it should make him away from sinful acts.
It is good to recite these Quranic supplications (RABBI A'OOTHO BIKA MIN HAMAZAAT ESH SHAYATEEN WA A'OOTHO BIKA RABBI AN YAHDHOROON).
Also this supplication (ALLAHUMMA AKHRIJ HUBBAD DUNYA MIN QALBI)
It is also useful to remember the end of those who committed sexual sins and got nothing but disaster in this life and hereafter. That should be enough lesson for every sensible person.