Books are useful sources for a number of reasons. In the past. authors compiled information or wrote about contemporary issues in a way that would be impossible or very difficult to obtain now. More recent books are also important. They are often the easiest means of learning about a subject and they tell you about how other historians have interpreted events. Books also tell us a great deal about the times they were published, their authors, and the society at the time.
People write and publish books and pamphlets for a number of reasons. Some people write for the money they hope to make. Others, like Justice Hugh MacMahon write for political or ideological reasons. Some books are created for civic or educational purposes.
Keep in mind, however, that the reason a book was written usually influences and can bias the content of the publication. Just because something is printed, it is not necessarily true. Published sources, just like unpublished letters, diaries, or government records, have to be examined and interrogated critically. Authors have their perspectives and agendas, they often do not have access to a complete set of the evidence, and they make mistakes. So when we find a published source we have to treat it as a theory and compare it to the other evidence to check for accuracy and bias. A description of an event is simply a piece of evidence until it is partnered with other pieces of evidence that begin to convince us that the event did indeed happen in the way that it was written.
Books are usually indexed by title and author, so finding them is not much different from doing a regular library search except that school libraries and small public libraries may not have older books. Nineteenth century books are fragile and often rare, so in larger libraries they are sometimes kept in a special part of the library called "Special Collections".