Every writer has a process that works for them. Some need complete and utter silence. Some like to go to coffee shops and use the background chatter as white noise. Some listen to music or have the television on even though they're not watching it. Some need an office of their own while others write on their porches, in the living room, etc.
I like to listen to music. It's usually classical music or movie soundtracks that have no vocals. If I listen to songs with words, I usually end up singing along and not getting much writing done. I write at the dining room table, mainly because it gives me space to spread out my research material, pages already written, and the like. Unfortunately, it means I have to stack up everything and put it away each night when it's time to set the table for dinner.
I have a friend who lights a candle each time she sits down to write. When she doesn't light a candle, she said it's harder for her to get words on the screen(page). She said it's like she's telling her brain the lit candle signifies writing time. (I've tried this myself and it does seem to make the words flow easier.)
I have a friend who writes her entire manuscript in long hand on yellow lined legal pads and then transcribes it onto her laptop. As she types, she edits at the same time so she feels she gets a good portion of editing done while typing the first draft.
I've written pages here and there in long hand when I'm out and a scene pops in my head and I don't want to lose it. I've also written in long hand when I have a problem getting a scene just right, but I couldn't imagine writing an entire 300 or more page novel in long hand and then having to type it into my Word program. But that's okay, because the process works for her. It doesn't have to work for me.
While there are certain rules in writing especially in specific genres, there's no one way to write a book and thank goodness for that.