in some cases, mere compression of the gas is sufficient to condense the water vapor to liquid, which can be drained away from the gas stream.
Chillers and cryogenic traps can condense and remove the water as a liquid or as solid ice.