Lithography was developed about 200 years ago as a method to print on paper. Print lithography involved the patterning of stone with wax. When water based ink is applied to a wax patterned stone, the ink will only stick to the exposed stone, not the wax. The stone effectively becomes a stamp to print on paper.
A different form of lithography is used to make tiny channels and pathways on a computer chip. A silicon wafer is first coated with a thin layer of silicon dioxide or other material. Another chemical, called photoresist, is then layered on top of the silicon dioxide in the desired pattern of the channels and pathways. The photoresist is very durable and chemically resistant. A powerful chemical etch is then used to eat away the silicon dioxide that is exposed, leaving the channels and pathways behind. The channels and pathways are still covered with photoresist, which is removed as the final step. This process can then be repeated over and over to create a complex three dimensional structure containing many layers. In addition, the individual layers can be made of semiconductor materials with whatever properties are desired, enabling the creation of miniatureized transistors, resistors, etc.

There are many other methods used to produce nanostructures. Some of them involve "self-assembly" in which the atoms and molecules line up all by themselves, and others require humans to put them together. Scientists have actually developed methods that use something like a nanosize pair of tweezers. They are able to pick up atoms and place them wherever they want, similar to building a model out of Legos!