Music and/or a song can only trigger 'bad thoughts' if you allow yourself to dwell on the past.
Listen to the same song/music in the present, in the here & now, replace historical thoughts with today's thoughts, and your mind can forever 'erase' previous thoughts the music/song may have evoked.
Today is most important, yesterday is gone. Listen to the music/song in today, relate it to today.
(For instance - there were many, many years I could not listen to the song Hotel California because we used to play it full blast when we were drunk & stoned. Then I listened to the song one time and imagined that the words were all about rehab. Now whenever I hear the song it has a whole new meaning.)