The environmental controls of a starship, space station, or even a colony were used to regulate atmospheric conditions including, but not limited to, the concentration of varying gases, lighting, temperature, humidity, and gravity.
Aboard Federation starships and space stations it was typical for there to be limited access to environmental control within crew quarters in order to meet the varied living requirements of these multi-species structures.
Environmental controls were often used to deploy certain chemicals ship-wide or station-wide. This was done for both benign purposes, such as the release of a retrovirus to cure a ship-wide epidemic, (TNG: "Genesis"; VOY: "Macrocosm") or for more aggressive purposes such as the release of a general anesthetic. (TOS: "Space Seed"; TNG: "The Hunted", "Clues"; VOY: "Message in a Bottle"; DS9: "Tacking Into the Wind")
When chief engineer Geordi La Forge left the USS Enterprise-E to make repairs on Zefram Cochrane's Phoenix he named Lieutenant Paul Porter as being in command during his absence. He also ordered Porter to check the environmental controls as it was warm in engineering. (Star Trek: First Contact)