The 19-year old undergraduate arrived at the student health center with an unusual complaint: Music had been stuck in his head for the past three years, and he could no longer cope. There was never just silence.

According to Dr. Zaid Yusufi Rafin, the psychiatrist that reported the case [PDF], it was a rare long-term manifestation of a pernicious earworm—a tune that gets stuck in your mind without your wanting it to. The student was able to reduce his earworms with cognitive-behavioral therapy, but short of a visit to the doctor, what can the rest of us do to rid ourselves of them? Here are five strategies, backed by science.

1. LISTEN TO THE ENTIRE SONG.

Earworms tend to be small fragments of music that repeat over and over (often a song’s refrain or chorus). A 2014 study evaluated existing surveys of people’s methods for coping with earworms and found that one of the most effective behaviors is just listening to the whole tune. Participants said they actively engaged with the offending music: They hummed or sang it, figured out the tune’s title and the name of the singer, or listened to the full song instead of the unwanted snippet. Some people listened to other music immediately after the ending of the earworm-generating tune as well.

2. LISTEN TO A “CURE TUNE.”

The same study also found that some subjects used competing songs, or “cure tunes,” to control their earworms. The researchers identified 64 such tunes, with six of them named by more than one person: “Happy Birthday to You,” “God Save the Queen” (the participants in the survey were British), The A-Team theme, “Sledgehammer” by Peter Gabriel, “Kashmir” by Led Zeppelin, and “Karma Chameleon” by Culture Club. In most cases, the cure tunes suppressed the earworms without becoming earworms themselves. In the rare occasions when they did, people said that they preferred to have the cure tunes stuck in their heads.

3. DISTRACT YOURSELF WITH SOMETHING ELSE.

Our brains are incapable of paying attention to more than one thing at a time, so any attempts to multitask are neurally doomed to failure. This limitation can be helpful when it comes to earworms. Strategies involving words, rather than music, can help nudge your brain away from the earworms and towards something else. Some effective remedies include talking with other people, meditation, prayer, watching TV, and reading.

4. CHEW GUM.

In a 2015 study, researchers suspected that the act of chewing gum might interfere with the formation of the auditory imagery needed to experience an earworm. How? Chewing might hinder the motor programming involved in speech articulation, and therefore could keep people from subvocalizing (saying the words to the songs in their heads). They found that vigorous gum-chewing did reduce the number of unwanted musical thoughts, but noted that not just any kind of motor activity leads to earworm reduction. When the study participants tapped their fingers upon the desk, they had more persistent earworms than when they chewed gum.

5. LEAVE IT ALONE.

Despite earworms’ involuntary and intrusive nature, research indicates that people actually don't mind them that much. A daily diary study concluded that only a small percentage of earworms interfered with daily activities, and other research has found links between earworms and feelings of wellbeing, both before and while experiencing the inner tunes. Another study found that earworms occur more frequently for liked than for disliked songs. For most people, earworms don’t play for very long. If you happen to love your internal soundtrack, just sit back and enjoy it while it lasts.