Good luck!
Edit: Of course, I forgot the reason why many folks also write a proposal: To shop it around, get an agent, and an advance. Problem is, that usually requires some connections in the industry, special expertise, compelling story, and/or all of the above. You don't need to shop it around to get the benefits, though it's nice to have if you happen to run into someone who could help.
1. Write an outline. This is boring, but vital. If you don't do this you won't realize that extent of the task you are taking on. By writing an outline you are convincing yourself and a publisher that you can actually write a book.
2. Do some other writing first. For example, I wrote extensively for different magazines. This is both good practice and gives you sample writing to show to a publisher.
3. "Phone a friend" Do your best to find someone you know who can introduce you either to a publisher or to an agent. This also applies to getting VC funding, it's best to find some way in via someone your know (or someone someone you know knows) than just trying to cold call.
4. If you do get a contract track carefully your progress (I used a spreadsheet) so that you stay on target.
5. Do not get hung up on the right tools to use. I've written plenty of stuff in a text buffer in emacs, or in Word, or using a specialist XML editor. Your publisher may actually ask you to use a specific tool, and the reality is that the tool is the least important part of the process. Figuring out what to write, and then writing the sentences is hard. (I'm not joking about the last part)
6. Read your work aloud. After I'd written a section I would read aloud what I'd written to see how it flowed. And I'd modify, read aloud, modify, read aloud until it seemed smooth.
How did you get O'Reilly to accept it?
I've been thinking about some cool books I would like to write for O'Reilly. I live 10 miles away from their headquarters, which might help me.
Are there any other north bay hackers out there?
2. I followed scrupulously O'Reilly's guidelines on submitting an proposal. I went through their normal channel for proposals and then I asked a friend who's an O'Reilly author to give them a prod for me.
3. I worked with the editor I'd been assigned to convince them that I could pull it off.
At first I used word (very lame, I know), but a friend recommended Scrivener (http://www.literatureandlatte.com/scrivener.html) to me a while ago, and I've been using that instead, but it's an OS X only tool. I love it. I'm not a writer, but I really needed some tools to help me finish nanowrimo, and scrivener is it.
I've occasionally used mindmapping tools for occasional papers I've written, if it's extremely chaotic you may want to look into that, although I don't know how much help it might be.
I recently wrote a book, and I got very little support from the publisher. It was a disaster, although I didn't realize that until after publication. I was the first person to write a Perl book for them, and they had nobody on staff that could even install Perl. The editors didn't do any significant editing, and in fact weren't even native speakers of English. They didn't even manage to publish the right version of some chapters. When they made the code from the book available, they did so as a word document containing code snippets from the book (instead of the runnable tarballs from each example and chapter that I provided for them).
Basically, your name goes on the book, so any fuck-up will be attributed to you. If something goes wrong, like things did with my book, you will get hate mail every day, criticizing you for things that you had no control over.
Oh yeah, and when the code you wrote the book about goes out of date, people will send you hate mail for that too. It is also apparently a hobby of people to nit-pick things like your variable names ("OMG you used $c instead of $ctx, YOU ARE SO DUMB!"). I'm not sure what motivates people to send me e-mail about things like this. Do they I think I care what they think? Do they want me to magically change every copy of the book? I don't get it.
In case you haven't noticed, the experience has changed my life. Before writing the book, I was really excited about open source projects and talking to people. I genuinely wanted to help people learn to program better. Now I am bitter and misanthropic because of the constant influx of hate mail. (I could go on and on about this, how people don't want to learn, how teaching is a waste of time, etc., etc... but I will save that for another day.)
I'm not trying to talk you out of writing a book, of course, but just make sure that your publisher cares about your book. If they don't, you may regret writing it.
Not only did they successfully kill jrock's book but based on his contributions to the project and associated work they also killed his motivation.
So: good publisher, thick skin, pick two or don't start.
If you're writing nonfiction, I'd guess that you'd start by researching whatever you're writing about. George Carlin once said that as an older man, he could make logical connections in topics he could never talk about before, because his knowledge was more comprehensive. Same with nonfiction: the more you know, the more ambitious your writing can be. (Same for fiction, of course, but with nonfiction you're more often writing about a specific topic.)
In both cases, outlines help a lot, but it's possible to work without them. It depends on what you want to write, and how you go about writing it.
The nonfiction equivalent is "just start writing index cards."
I've read where some people create a PowerPoint presentation and work backwards from that as well. The key thing for me is that I don't want to get tied down to Chapter 1, Chapter 2, etc too early - I want the flexibility to move things around without hindering my thinking process. That's the sort of thing that is perfect for mind mapping tools like FreeMind (http://freemind.sourceforge.net/wiki/index.php/Main_Page).
If you're writing for a publisher, then they're going to give you a template that's probably for Word, and you don't have to worry about complicated document struturing stuff -- they'll help with the referencing, etc.
If you're doing it all yourself, then a document description system such as LaTeX might be the way to go. If I was writing a technical book that i knew had little chance of being published, I'd probably use that.
Fiction writing, on the other hand, can go totally chaotic... but I imagine the OP is talking about non-fiction.
Then, don't start rewriting your manuscript. Burn it and start all over again.
I've never written a book, but I plan to eventually, and this is the approach I plan to take.
After a year of feeling a little bummed about it, I tried again, this time pre-clearing topics with the publishers and got a proposal accepted.
But the advice that stuck with me is to just write. Sure, plan out what you're going to write ( topics + sub-topics for non-fiction, storyboard for fiction), but otherwise, just let the words flow. You're going to butcher the crap out of it later on when you start editing it anyway, so don't _start_ by worrying about it.
It's writing, but not (yet) writing a linear, not to mention final, draft.
I understand that these days some people work in a similar fashion, but with Post It notes. The advantage being that you can spread them out over a table or wall or similar (walls are then a convenient source or otherwise unoccupied surface area), and they won't be as easily inadvertently jostled out of order.
If you are worried about losing a card organization scheme, when they are laid out in such fashion you can take picture(s) in order to preserve a record. This can also serve as a backup mechanism against losing the cards.
It also works for handwritten notes. You do not need to spend a lot of time on the pictures if that time is not productive. But the pictures are so easy to take -- one can just snap them at the end of each day or workday. If your 4 year old randomizes your stack, or you forget your notebook while juggling 3 other things, all is not lost. If that never happens, all you've lost is a couple of minutes' clicking and some non-volatile memory capacity.
Behind all these comments, is the fact that for me, writing long hand is still sometimes most productive. If the volume of output is less, the concentration tends to be higher. And it can be accomplished most anywhere, at a moment's notice.
Do you have a contract and an agent yet? I learned the hard way the value of a good agent.