Music is a popular tool for novelists for several reasons. When trying to work in a large, noisy crowd, music may be used to drown out unnecessary chatter. For those who need background noise to work effectively, it can serve that purpose as well. Music can also be soothing and reassuring during those days when nothing you write seems any good. I've used music for all of these purposes, but I most often use it as a boost of inspiration.
One of my favorite things to do is match characters to songs as I'm listening to them. Sometimes when I do this, a brand new character will come to life in my head and begin to tell me their story. Other times, I'll hear a song that perfectly matches one of my pre-existing characters, or that adds to their story in a way I never would have imagined. Whichever order it happens, assigning a character a song (or several songs) helps give me direction on what to do with that character's personal conflict, motivations, and growth throughout the story.
My exact process for matching characters to music is a little bit difficult to explain, but song lyrics are a huge part of it. When I listen to any song, the first thing I do is analyze the words. I don't do this to discover what the artist is trying to say, necessarily, though sometimes that can be helpful as well. More often, I listen carefully for things I can twist. By this I mean phrases that could mean something different in a different context or things that could be taken literally instead of figuratively (or vice versa). For example, take the chorus from a song called Two Worlds Collide:
You had your dreams, I had mine.
You had your fears, I was fine.
Showed me what I couldn't find,
When two different worlds collide.
When I heard this song, not knowing a thing about where it came from or what it was actually about, I immediately analyzed the lyrics. At the time, I was working with two characters who were literally from "two different worlds." I enjoy working with alien species in my stories, so I had one character who lived on land and another who lived under the sea. They were friends, but because of tension between their races at the time, they were forbidden from talking to each other. If they were caught, they would both be killed. One of the characters was an optimist and didn't think anything would happen to them, but the other was afraid. The lines of the chorus suggested that sort of conflict to me.
Other lines in the rest of the song stuck out as well. For example, the line "She tried to survive, living her life on her own, always afraid of the throne," further suggested the threat of death if authorities found out. The characters' friendship and hope for the future was further emphasized by lines like "I can survive with you by my side. We're gonna be alright. this is what happens when two worlds collide." These lyrics greatly influenced my story's main conflict. It wasn't until later that I realized the song was actually from a movie called the Princess Protection Program, and was about the friendship between a princess and a regular girl whose house she was temporarily occupying. It was a completely different type of story from my little science-fiction tragedy, but since both carried the same central theme, the song was able to apply to both.
Music doesn't work like this for every writer. Everyone is different, and what works for me may not work exactly the same way for everyone else. Still, it's a good tool for a novelist to have. Sometimes listening to a song or two can redirect the entire course of a story, often for the better.