A good TV writer needs all the same tricks a good novelist has.
I write while listening to music, mostly because the world beyond my headphones is too chaotic.
Music - which I could never listen to while writing before I had children - became essential to my process.
Once I have a book in my head, I write progressive drafts fast and obsessively and have trouble sleeping.
The writer's job is to let the books speak for themselves eventually.