If you want to get published, you have to write, a lot. When you are writing - really writing - you're not thinking about publication, much like an artist that is painting isn't thinking of the opening night of his exhibition in some posh city gallery. Stop thinking about the publishing process, and get to writing.
Good writing comes from good writing habits. Good writing habits are those that are effective - for you. Writers have an insatiable curiosity for understanding the writing habits of other writers, particularly those more successful then them. You can get a lot of good ideas looking at other writers' habits, but remember that these are not going to be a simple recipe for success for you.
Last year I blogged about a YouTube clip of Jeffrey Archer talking about his own writing habits. It really is a fascinating clip, and I've watched it many times since. I can assure you though, that I'll never adopt his habits. Actually, I have taken to writing long-hand with a felt-tipped pen since then. I like it.
Just recently, the prolific and widely published dark fiction author Angel Zapata used his blog A Rage of Angel to share a little about his own writing habits. The post is titled Writing Habits-Dawn of the Gummy Bear. I highly recommend that you read it, and the comments that follow. The post and comments have triggered a discussion with other writers about their own habits. You'll notice one thing about the comments: everybody is different. What works for one person will never work for someone else.
Should you play music while you write? Should you write in the morning, or late at night? The answer is: do what works. I'd urge you to consider one thing, though: be very careful about making your creative connection dependent on any drugs or alcohol. I'm not telling you what to do with your life; but I think it's very dangerous territory to establish a writing habit that makes good writing output depend on chemical stimulants. When you find yourself wanting to write more, and better (which you will), then you may find yourself with a substance problem. Then, if you get over the problem, you will struggle to re-establish that creative connection again, with cleaner methods. Gummy bears are a good, safe alternative.
If you want to get published, it's important to be up-to-date on the publishing industry, to know how to write a query letter, and to browse through the blogs of agents and publishers. More important than all of that however, is the need to get down and write. Find out what works for other writers, find out what works for you, and then develop your own successful writing habits.