بسم الله الرحمن الرحيم
You should try to avoid sins and the intention of sin. When your heart tends towards any sin, get yourself busy in any lawful job and start reading durood. Also follow sunnah and pass your life according to it.
Recite Ya Qawi (يا قوي) after five times of salah putting your hand on your head.
Allah knows Best!
Darul Uloom Deoband