For a song to get stuck in the first place, catchiness is a major factor. A combination of tempo, volume, rhythm or lyrics is what catches the brain’s attention. Once that occurs, there is a possibility the song will start repeating.
If so, neuroscientists have developed a few strategies that may help eliminate earworms. The first is simple enough: chew gum. Researchers also discovered at Western Washington University that solving simple anagrams or sudoku puzzles counteracts earworms. Listening to audio books or instrumental music sounds like the most likely solution by simply changing what the brain is hearing.