Hi there millie1
Out in the wild, fish have vast quantities of water to dilute harmful things that might be in their water. Unfortunately, even the biggest aquarium is much too small to achieve all of what nature does for the fish, without help from some artificial systems.
When fish "breathe" through their gills, they give off ammonia. Their waste breaks down to ammonia. Any excess food they don't eat breaks down to ammonia. Any dead plant material breaks down to.. you guessed it, ammonia.
Ammonia, even in tiny quantities in an aquarium, burns fish gills and causes permanent damage to the fish. Even if it lives, it is never quite the same internally.
Another poison for fish is nitrite (NO2). Nitrite molecules attach to the hemoglobin of fish blood and replace the sites there that should be carrying oxygen. The fish begin to suffocate and suffer permanent damage.
When you buy an aquarium filter, it is just a raw collection of hardware, a "kit" as it were, and it needs often about 4 to 8 weeks of knowledgeable preparation before it is ready for fish. Fish should not be introduced to an aquarium until this work has been performed.
We call the this filter preparation work "Cycling." The term comes about from the environmental process called the Nitrogen Cycle, and when we prepare a tank properly, before there are fish, we call it "Fishless Cycling." (If something goes wrong or someone doesn't know yet about fishless cycling and there are fish in the tank, then we call it "Fish-In" Cycling.)
[

ok, hang in there, this may look long, but its really fascinating and pretty easy reading]
To prepare our filter with a fishless cycle, we set up our whole running aquarium without fish. We go out and find the correct type of pure household ammonia and add it in small controlled amounts to the aquarium water. Amazingly, no matter where you are, there will be certain types of bacteria that will begin to eat this ammonia and grow in a colony.
In our filter we put try to put the perfect media that will have surfaces for the bacteria we are trying to grow. We test and monitor our water so that it is just the right sort of "soup" the bacteria like. We are trying to grow two specific species of bacteria.
The first species (let's call them "A-Bacs" for ammonia oxidizing bacteria) will eat ammonia and from it, produce nitrite (NO2), unfortunately the other poison for our fish! The second species (let's call these "N-Bacs" for nitrite oxidizing bacteria) will eat the nitrite (NO2) and from that they will produce nitrate (NO3) (note the slight difference in these words!)
Luckily, nitrate (NO3) is not nearly as harmful to our fish and can be removed from the tank via weekly water changes.
So fishless cycling is the process of growing the A-Bacs and the N-Bacs on the filter media (the sponges, rings or pebbles.. there are various media that work) by having fresh, warm, oxygenated water flow through the filter with the food the bacteria love (the ammonia and subsequently, the nitrite) until we see by our testing that the bacterial colonies are large enough and healthy enough to keep the water clean for a full stocking of fish.
There are all sorts of helpful and friendly TFF members here who enjoy guiding new hobbyists through this fishless cycling process and helping to make it easier, often because someone previously helped them in the same way!
Anyway, this is basically what many of the articles will be telling you (but sometimes in more detail), so I hope this was helpful, and good luck in your own learning!
~~waterdrop~~