Song in my head

I often have songs playing in my head, both day and night. Usually, they don’t bother me, but if I’m trying to fall asleep, they seem to keep me awake. If I get frustrated enough and can’t fall asleep, I try the following: to notice that I’m “singing the song’ (meaning I observe that my brain has a song in it), and then I replace it with: I’m going to relax and fall asleep. Sometimes I can fall asleep with only needing to do this a bit, and sometimes I stay up with a banter between the song and my observing of the song and my intention to “replace” the song, which then leads to further frustration. Do you have any suggestions? Also, is it true that the song is coming from me—because it often it seems like it is coming from somewhere other than my brain