Urban lifestyles and industrial processes produce large amounts of waste water, which must be treated before it is released into the environment. Sewage and agricultural waste water need organic matter and harmful microbes removed. Industrial waste water may need organic matter and harmful chemicals removed.
Sewage treatment has four main stages. First, screening removes large objects, and grit removal takes out sand and stones. Next, sedimentation lets solids settle to form sewage sludge, leaving a liquid called effluent. The sludge is broken down by anaerobic digestion, which happens without oxygen. The effluent is treated by aerobic biological treatment, which happens with oxygen.
Getting potable water is easiest from ground water, which needs little more than filtering and sterilising. Waste water needs several treatment stages. Salty water is hardest, because desalination needs large amounts of energy.