There are different reasons for cloudy aquarium water and all must be addressed to prevent your fish from becoming deoxygenated and dying. First, let's look at discoloration that is not harmful to the aquarium. Grayish brown water just means the gravel is still dirty; however, most of the dirt particles will be removed by your filter. Yellowish or brownish colored water is caused by the breakdown of organic matter. This can be remedied by use of activated carbon in the filter, which should be changed weekly, or as soon as the water turns color. In most cases, you can wait for bacteria to settle to the bottom and the water to clear itself. Do not add chemical media. But if it is already in the filter, leave it, since it may contain nitrifying bacteria that break down harmful ammonia.
If the water is white or grayish, however, there is a bacterial bloom, which is caused by too many nutrients in the water, causing bacteria to grow and ammonia levels to rise, which are dangerous for the fish. Sometimes this is caused by cleaning the filters or changing the gravel, which stirs up bacterial colonies that had settled in them. Use of antibiotics to treat the fish is another cause. Green water is particularly bad because it signifies an algae bloom, which can deplete the tank of oxygen, suffocating the fish. This problem is caused by excessive nutrients and too much direct light. Algae consume oxygen at night, converting it into carbon dioxide. So when the lights are off, oxygen must be supplied to the aquarium. In addition, the filter media should be changed and the gravel vacuumed to rid the tank of decaying matter.
Because bacteria thrive on nutrients in the water, it is important not to overfeed the fish. Water changes are especially important in ridding the tank of excessive nutrients, but do not change the water or filter media just because the water looks smoky unless the fish are in respiratory distress, coming to the surface, breathing hard, or staying by the filter output. Instead, test the water parameters. To get more oxygen, use an air stone and air pump, which oxygenates the water. Test for ammonia and nitrite levels. When nitrite-consuming bacteria reproduce, they turn the toxic nitrite into less toxic nitrate. Test until the levels go down to zero. Test for water hardness. If the water is hard, use water softeners before adjusting the pH. Next, test pH levels. Lowering pH to about 7.0 or below in freshwater can make ammonia less toxic. Only if the fish are in respiratory distress, do a small water change. Remember, you also will be throwing out nitrifying bacteria during a water change, so do it only as a last resort. Make sure the biological filtration is working. Observe the fish each day until the cycle is completed. You can treat the aquarium with bacteria additives to speed up the nitrification process. With proper care, the cycle should adjust itself and the water eventually will clear.