Hihi, I was struggling with that one for a long time too. What I have learned is that our brains are not that good with negation. It is very obvious at childrens age but it does stick around. When you say to a child "Do not eat that" they do not perceive the word "not" and act like you did not say it. It is a strange mechanism and there are many parenting books written where advice to substitute no and not with STOP, is given. There is stop and there is diverting attention.
As adults, we still struggle with no and my suggestion is that we also use the stop method but some others too. Instead of repeating a thought about not doing something, try repeating one about doing something else. It is not ideal and I will not swear that it works all the time lol but it does help occasionally :)