It varies from person to person.
How you write the actual book depends on your method, be it the "Snowflake" the "Seat-of-the-pants" the "Edit as you go" or the "Outline."
Snowflake is some planning, but most little things just come as you write the story.
Seat-of-the-pants is where you just write. While this can be fun, it requires MAJOR editing.
Edit-as-you-go is self explanatory. Sometimes an author will rewrite a scene ten times before moving onto the next.
Outline is where you do an extensive outline on near everything. These outlines often range from 20-50 pages. This method may not be as fun as seat-of-the-pants, it requires MUCH less editing.
Snowflake seems to be most common, so I'll discuss that.
You do some planning, you work out most of the major twists and events, but dialogue and detail is left for the writing. You write your first draft.
Then you edit. You take out pages, sometimes even chapters that don't work into the story. My favorite way to do this is to write a second draft, where I try to cover up any plotholes, change twists or anything that don't work and tie off any strings I didn't tie off in the first draft.
The most drafts I write is three, but some go as far as 10, or 20.
PUBLISHING
The Writers Market 2010 will help you find agents and publishers, so I recommend getting it.
First (Not needed, but highly reccommended) you should send a query to an agent. Some publishers won't even LOOK at a manuscript unless it's been submitted by an agent. A good way to find agents is by attending writers conferences.
If a publisher likes you, he may ask you to come for an interview, and consider publishing you.
I'm sorry, thats about as far as I know. I don't know the process of getting into stores.
---------EDIT---------
Also, obviously you will need an idea. I sometimes spend two years developing one, and then give it up. I usually sit down to write a sypnosis of the basic stuff I have, and then the ideas just flow. THEN, you write your first draft.
---------EDIT----------
One more thing. WRITERS BLOCK occurs when you're worried about failing, and when you're stuck because you're trying to be in creative and editing mode at the same time. When I do a first draft, I have some ideas, but then just let my imagination and my pen(well, keyboard actually) do the rest.
---------EDIT---------
And remember, make sure your manuscript is as completed and as close to perfect as you can possibly make it before sending it to an agent or publisher.
---------EDIT---------
It seems I forgot to mention characters. A three-dimensional character is a character with values, especially one with CONFLICTING values. Make them seem REAL. Give them real flaws and real personalities. They have to be believable for people to feel for them and relate to them.