Here are John's tips. While these are mainly for non-fiction, they can also easily apply to fiction.
1. To get a book deal, just start doing it. Start writing, blogging, doing what you love and having fun doing it. Pick something with tangible results so you can see the outcome, and enjoy what you're doing. A lot depends on timing. Put yourself out there, go to events where there are like-minded people, and talk about what you're doing.
(This one really rang true for me. I met my publisher as a result of trying to get myself out there to meet other writers. )
2. Write the right book. It has to be fun for you, and it has to feel natural. Make sure your book solves a problem for people. The title and cover are both worth spending time on - make sure they're eye-catching and memorable.
3. Write the book in a way that feels like play, in a structure that keeps people engaged and in a way that works for you.
(I love this point because it's so easy to forget to enjoy writing!)
4. Get a good publisher who can help you structure your book, do a great job editing and help out with marketing.5. Play your way to market the book. This goes back to networking and putting yourself out there. Due to social media, authors have more control over how they can market their book. Get on Twitter, Facebook, and start your own blog and website -- you don't have to wait until you have a book deal. Give people incentives to sign up for newsletters (etc - extracts from the book), and keep them updated. Use your contracts, colleagues' contacts and have a co-ordinated campaign to drive Amazon sales.
6. The most important: write a good book!