One thing that is really important in keeping water quality in check is to be sure to not leave any dead critters in your aquarium any longer than you have to. Why?
I had a Cardinal die the other day, it was weird, it just kinda turned up dead without any warning signs. But either way, as soon as I noticed he was a goner, I removed him from the tank.
If you leave fish in the aquarium after they die they will pollute the aquarium with bad chemicals and ruin your water quality. This can really be said about any living organism that dies in the aquarium, but dead fish can have the worst impact.
It also may not hurt to do a water change or check your water parameters a little more frequently after a fish dies. It can help to ensure that nothing veers off the normal path in terms of aquarium balance. I usually do water changes if I notice that something has recently died.
Luckily, I don’t really lose fish anymore due to the fact that I’ve been able to keep my aquarium in balance for a steady amount of time. But sometimes things just happen, so I need to be on guard and always on the lookout, even if nothing really ever does happen. It’s always that one time that a person doesn’t decide to check on an aquarium that something spirals out of control, unobserved. I like to try avoid those bad luck situations as much as possible.