The Library is a very important building. You will want to build it as soon as you have about 10 Books saved up. It gives +1 Knoweldge every 24h. Knowledge is used in the construction and upgrade of many buildings. You can also get Knowledge randomly from Neighbors Library or if they have a Large Library it will drop 100% of the time.
You can get Planks from Neighbors Lumber Mill (Any level)
Books are crafted in the Laboratory and require Paper so you will want to build the Paper Workshop before you build the Library.