Science is here to help:
We humans — cognitively, at least — like to finish what we’ve started. So even when our conscious minds move on to a new thing, our unconscious minds can still be preoccupied with our unfinished business, leading to dissonance. … To defeat an earworm, [researchers at Western Washington University] suggest, you just have to fool your brain into solving another puzzle — a non-musical puzzle. The best way to do that? Give it actual puzzles to concentrate on. Do a quick crossword. Tackle an anagram. Spend a few minutes, even, reading a novel. Replace the earworm with another worm, tricking your mind out of its need to finish what it started by giving it something else — something simple, but not too simple — to focus on.