According to The Goldfish Tank, goldfish in the right environment can live for many years in spite of their reputation for not having a long lifespan. Goldfish-as-Pets.com explains that the leading cause of death in goldfish is poor water quality, which is often caused by overfeeding that results in the build-up of uneaten food.
Goldfish-as-Pets.com goes on to explain that any food remaining in an aquarium after 5 minutes of feeding needs to be promptly removed. If the food is still floating, a net can be used to scoop it off the surface of the water. On the other hand, if the food has drifted to the bottom of the aquarium, fish owners should use a specialized hose for cleaning gravel. Uneaten food rots quickly and ruins the quality of the water.
The Goldfish Tank states that inadequate filtration and space are also leading causes of goldfish death. Goldfish produce a heavy amount of waste that is too much for a small or weak filter to handle. Due to the amount of waste a goldfish produces and its eventual large size, a single goldfish needs 20 gallons at a minimum, and every additional goldfish needs another 10 gallons, according to Complete Goldfish Care.