Cloudy water is typically caused by a bacteria bloom. Usually if you do too much maintenance on the tank, if you clean the filter, do a big water change, gravel clean, you're going to be upsetting the balance of the aquarium. Bacteria is going to take to the water column and start scavenging waste out of the water right in the water column.
In time, usually, it settles out. But, if you want to speed up the process you can add bacteria to the system. Most of the bacteria that you add will colonize the filter, colonize the gravel, and outcompete the nuisance bacteria that's colonized the water column for nutrients.
You can also use a UV sterilizer. A UV sterilizer will prevent the bacteria from reproducing because bacteria have a very short life. As they reproduce, when they're exposed to ultraviolet light, it causes a lot of mutations in their genetic sequences and they can't reproduce. You'll have a very sterile environment within a few days, so anything living in the water column will be eradicated. You'll have crystal clear water within three to five days depending on the size of the tank and the size of the UV sterilizer. So UV sterilizers are great for curing cloudy water.
If the water is clouded from particulates you can use a coagulating agent such as Acurel F or anything that's made for cloudy water. What it does is it clumps a lot of the particulates in the water and allows the filter to extract them out of the water. Otherwise, just doing your water changes, making sure the filter's clean, cutting back on feeding usually will allow the tank to balance out and get clear again.
If you think the water's cloudy but it really has a greenish tint when you look through the side the greenish water is caused by algae not by bacteria. That can be controlled by cutting back the available light. Usually sunlight or keeping the light on 24 hours a day will result in like a milky, cloudy, greenish appearance to the tank.
You want to decipher between green water and cloudy, milky water. Cloudy is usually bacteria driven. Green is usually algae driven.