I have read that prior to putting fish in an aquarium, one must "cycle" the tank so that bacteria that oxidize ammonia will produce nitrite, and nitrite-oxidizing bacteria will make nitrate. I understand the chemistry behind it, but I'm not really sure what is the best practical method to do this. I'd love to start an aquarium, but this task seems daunting.
First, a little background on the aquarium nitrogen cycle.
Fish produce ammonia, which is extremely toxic to the fish. Unlike in a natural body of water, in an aquarium there is nowhere for this toxin to go, so it builds up fast. Luckily, there is bacteria in your tank that converts ammonia into nitrite. However, nitrite is also extremely toxic to fish. So it is good that there is another type of bacteria in your tank that converts nitrite into nitrate. Nitrate is also toxic to fish, but not nearly as much so as ammonia or nitrite, which means it is easier to manage with water changes.
When you first set up your aquarium, the population of these bacteria is low and needs to be built up. So the goal of "cycling" your aquarium is to get the population of bacteria up to where it needs to be to keep your fish healthy.
One way this is done is to simply put cheap fish in your tank that will bring bacteria with them from the pet store. The problem with this approach is that the first several fish you put in your tank will likely die, as the population of your bacteria has not grown yet. Your cycling is complete when the fish stop dying.
Instead, I have had great results with fishless cycling. The idea is that you set up your aquarium with the heater and the filter, but before you put any fish in it, you add drops of pure ammonia to feed the bacteria. Then you test the water every day for ammonia and nitrite to check the progress of the bacteria population. When you get to a point where you can add ammonia, but the ammonia and nitrite are quickly processed by the bacteria, then your tank is ready for fish.
There is a great article on fishless cycling with details on a good procedure here: Cycling Your First Fresh Water Tank
The whole process can take a few weeks, and it can be sped up by introducing something from an established aquarium, such as a decoration or a plant, that will bring some bacteria with it. However, if you do bring something over from another tank, make sure it is a healthy tank, as you can also transport diseases to your new tank.
The easiest way I know is to "transplant" from a good, running aquarium, so that all those desired bacteria will begin to reproduce in your aquarium and make that cycle.
For my last aquarium, since it was a bigger one, in which I invested more, I prefered to make things slow: first set the rocks and substrate, then I added plants, then I added 5 fishes every week, until a whole month has passed. After that, I went to the final population, and almost all they survived :)
Back when we had an aquarium we just took it slow.
First you fill the aquarium with sand, rocks and all other non-living decorative stuff. It is advised to wash and clean the sand before putting it in the aquarium. This reduces dust and possible contaminants that might have aggregated in the packaging process.
After some hours up to a few days, after the dust has settled, you can start placing the plants. If possible you should use rainwater instead of tap water, especially when the tap water has been treated with chemical (If it isn't safe to drink I wouldn't put fish in it). Water from other natural sources can be contaminated with organisms that store bought fish are not used to.
After planting, there are starter liquids (or substrates) available in stores than contain the organisms needed. At this point you should activate your pump so that the bacteria can start inhabiting the filter materials.
After another few days, a week to be safe, the aquarium should be safe to host the first bunch of fish.