I haven't mentioned anything about how your ammonia and nitrite got high. You must have some filter bacteria or your nitrate level would be the same as your tap level. So why did your ammonia and nitrite go up? We need to find out so it doesn't happen again.
Did you do anything to the filter before the ammonia and nitrite appeared? Change the media or even the filter itself? Wash the media under the tap? A lot of the bacteria live in the filter media so changing it throws the bacteria away. And the chloramine or chlorine in tap water kills bacteria, particularly if the tank hasn't been running long.
Did you get any new fish? If so, how many fish were already in the tank and how many new fish did you add? There are only enough bacteria to 'eat' the ammonia from the fish currently in the tank. If a lot more fish are added at one go, the filter bacteria have to multiply to make more of them to 'eat' the ammonia made by the new fish. It can take a few days to catch up if a lot of new fish are added at once.
Did you do anything to the filter before the ammonia and nitrite appeared? Change the media or even the filter itself? Wash the media under the tap? A lot of the bacteria live in the filter media so changing it throws the bacteria away. And the chloramine or chlorine in tap water kills bacteria, particularly if the tank hasn't been running long.
Did you get any new fish? If so, how many fish were already in the tank and how many new fish did you add? There are only enough bacteria to 'eat' the ammonia from the fish currently in the tank. If a lot more fish are added at one go, the filter bacteria have to multiply to make more of them to 'eat' the ammonia made by the new fish. It can take a few days to catch up if a lot of new fish are added at once.