In either place, take the same approach. Try to find books that are in a similar genre, target a similar age group and take a similar approach to the story you're working on. At the library, break down the books you find and attempt to determine what's made them successful. Delude yourself into thinking that everything you've done is beyond the need for tinkering and you'll be on your way to a nice collection of rejection slips. At the bookstore, search for similar books and make a note of the publisher's name and address.
Many publishers prefer to create their lines around common themes, topics and age groups.
When you've narrowed the search down to those publishers who seem best for your story, start sending off for writer's guidelines from those companies. Address your letter to the Editorial Department, and enclose a note requesting a copy of their current writer's guidelines. You can also ask for a current catalog, which will list all the books the publisher currently offers. Follow the guidelines religiously. They're instructions that will tell you exactly what the publisher is looking for and how they like to be contacted.