It is very important to understand that keeping fish is no less of a responsibility than caring for any other pet, in fact sometimes even more so. Fish are 100% reliant on their owners not only for food to eat and attention (yes many fish need to be stimulated in order to stay healthy), but also to breathe. Fish eat, sleep, and breathe all in the confinements of your aquarium. By choosing to keep fish you are solely responsible for their whole existence.
Fish produce waste in the same water that they use to breathe. In order for this water to stay clean a naturally occurring phenomenon called the Nitrogen Cycle needs to take place. As fish produce waste in the form of urea (pee) and feces (poop) it is added to the water column and contains Ammonia (NH3) which is highly toxic to fish! Some of this waste may make it to the bottom of the tank, where gravel or sand forms your substrate and needs to be vacuumed to avoid fouling your tank water, and most will make its way into your filter.
Filtration is a very important part of the ecosystem that you are creating, as it houses biological media in the form of sponges, textured surfaces, ceramic rings, etc. which catches this Ammonia waste and the BB (beneficial bacteria), essential to the nitrogen cycle, will grow and live on these surfaces in your filter. This bacteria will eat the fish waste and convert it into Nitrite (NO2), which is also highly toxic to fish! As these levels raise in your tank a new type of bacteria will form which specifically eats Nitrites. The natural waste of these bacteria produces a salt acid called Nitrate (NO3) which thankfully, at controlled levels, is much less toxic to fish and can be tolerated to varying degrees by different fish species. But of the 3 main compounds, Nitrate is the best (within reason).
Levels of Nitrate can be kept under control with scheduled partial water changes as well as live plants (freshwater) and macroalgae (saltwater) in an aquarium. There are other, more advanced, techniques for nitrate management in both fresh and marine systems but this is just the basics. As long as your Bioload (the amount of animals creating waste) doesn't exceed your amount of Beneficial Bacteria that can convert the waste, you have a cycled aquarium that is safe for fish.
There are bottled products that have these Nitrifying Bacteria in them and are sold to allow you to use them to add fish the same day you set up your new aquarium. This is risky, as it takes most aquariums anywhere from 4-6 weeks to fully cycle. These products can be used to give a new tank a kick start, but should not replace the process of fully cycling your tank, except by the most advanced aquarists. If you do decide to use a supplemental source of bacteria we at Aquarium Solutions 101 recommend Dr. Tim's, it is what we use in our tanks.
A liquid test kit (very easy to use) which measures pH, ammonia, nitrites, and nitrates is required to know your water parameters and find out if your tank is cycled. Almost all aquarium fish deaths occur because of poor water quality issues. If your tank isn't cycled and you don't know your levels of each of these toxic compounds then you aren't being a responsible pet owner. It may seem complicated at first but it truly isn't. Fish waste is toxic to fish, bacteria form that eat that waste and make an even more toxic waste, then some ultra bacteria eat that and their waste is the least toxic of the 3 and can be controlled, that's all there is to it.
If you have any comments or questions please leave them below. We'd be happy to hear your thoughts! Remember this is a basic explanation of what the nitrogen cycle, how it works, and why it is important.