I’ve been getting those dreams a lot lately too. It can be hard to get them out of your head, but make sure you keep trying. Letting those get any root inside your mind will lead to a nasty urge. It may seem futile sometimes, but continual effort towards redirecting your focus onto something else whether it be a mental image or something physical will help you to rid yourself of those urges.
For me what’s worked continually on this streak is something called the X technique. I posted a good description of it just a bit ago so I’ll just bring that up below. Give it some time and effort and you might find it very helpful.