So what I've come to realise is that over time sins that may be minor or major, if done over a period of time become less and less wrong in our eyes. However we justify it to ourselves ultimately the guilt erodes. Now I'm not saying this is acceptable however I am saying it happens. You can deal with it in different ways this is how I've been dealing with it. Ideally we shouldn't repeat the sin but for some it's hard and it becomes a sort of addiction.
First of all identify in your head it's wrong. And reprimand yourself.
Second of all, erase all resources to this sin. It's important to stay away from it even if you don't feel guilty. Continue to stay away and strive to do good deeds.
Lastly remind yourself of the punishments of this particular sin.
It might also be helpful to try and become closer to God in general. Make more effort to practise your Deen and gain closeness to Allah.