This post on Brain Pickings shares the writing habits of a number of famous authors. Trends that carry through include personal rules for times of day and locations for writing as well as a strict adherence (with occasional opportunities to bend the rules) to regular routines. Here is a quote from Ernest Hemingway on his method (from A Moveable Feast), which I have found quite helpful in my own writing (italics are my own):
When I am working on a book or a story I write every morning as soon after first light as possible. There is no one to disturb you and it is cool or cold and you come to your work and warm as you write. You read what you have written and, as you always stop when you know what is going to happen next, you go on from there. You write until you come to a place where you still have your juice and know what will happen next and you stop and try to live through until the next day when you hit it again. You have started at six in the morning, say, and may go on until noon or be through before that. When you stop you are as empty, and at the same time never empty but filling, as when you have made love to someone you love. Nothing can hurt you, nothing can happen, nothing means anything until the next day when you do it again. It is the wait until the next day that is hard to get through.