Yep, Brigid's got the gist of it. When querying, each book has one chance with each agent (or agency if it's "no from one is no from all" like she says), so you want your book and query to be the absolute best you can make them. It doesn't have to be the best POSSIBLE book, your agent and publisher are supposed to help you get it there, but best within your own ability.
Now, before you get there, you can absolutely prep for querying at any point. Write the query and synopsis (the latter's best left for when the book is done) and test them out in QLH (once you have 50 posts), refine them so that when the book is ready, your query and synopses are too. Start making a list of agents you can query to and what they want with the submission. And, of course, keep hanging around and posting here. Read and critique some queries and synopses so that when you're ready to dive into yours, you have some experience (Plus the critters here really love helping people who've become familiar faces in the critting circles.) Becoming a familiar face will also open up doors for finding beta readers here, because we like to help each other out.