Fish produce ammonia as waste which is toxic.
Bacteria grows mostly in the filter and "eats" the ammonia and converts it into
nitrite which is also toxic.
More bacteria grow and "eat" the nitrite and convert it into
nitrate.
Nitrate is not harmful until it gets over 20; weekly water changes keep it down.
The process of "Cycling", or growing enough bacteria to constantly "eat" all of the ammonia and nitrites, takes about 6-8 weeks.
If you cycle with fish, you need to do frequent water changes to keep the ammonia from getting too high.
A better option is cycling fishless; you can either pour in pure ammonia daily to start the cycle, or drop in fish flakes twice a day which will rot and produce ammonia. Then by the time the tank is cycled and you add fish, there is enough bacteria to take care of all the fish wastes.
This process is vital as is testing your levels weekly to make sure they don't get too high; in a cycled tank the ammonia and nitrite should remain at 0 unless something harms the bacteria (such as some meds), but nitrate can build up quickly.
hope this helps!