Fish turn fish food into ammonia. Ammonia is poisonous to fish. So you have to get the ammonia out of the tank.
The best way to get ammonia out of your tank is with some (what I'll call) ammonia bacteria. They eat the ammonia and turn it into nitrite.
But nitrite is also poisonous to fish. The best way to get nitrite out of your tank is with some (what I'll call) nitrite bacteria. They convert nitrite into nitrate.
Now nitrate is simply fertilizer. It's not hazardous to fish until it gets like 100 times more concentrated than levels of ammonia that can kill a fish. But before nitrates get to that level, you do a pwc (partial water change) to lower the nitrate levels. A pwc is when you remove SOME of the water in your tank (10% to 50%) and replace it with fresh water.
Now you don't have to go out and buy ammonia and nitrite bacteria. They already live all around us. But it takes a while (like 4 to 6 to 8 weeks) before they can establish a large enough colony in your tank to convert the ammonia the fish create into nitrates. The process of growing these bacteria colonies is known as cycling a tank.
For now, you need to buy an ammonia test kit and a nitrite test kit (you might as well get a nitrate test kit while you are at it). Get the liquid kind, not the test strips or test meters. What you will need to do is test the water in your tank every day for ammonia and nitrite. If either gets too high, (say above 1.0 ppm or so) you need to do a pwc to get those levels back down. In the early stages of cycling a tank, depending upon how many fish are in the tank and how much you feed them, you might have to do pwc every day to keep levels low enough.