When natural gas is turned on, a device called a gas valve opens, allowing the gas to flow through. The gas then passes through a pipe and into a burner, where it is mixed with air and ignited by a spark. This creates a flame, which heats up the air around it and produces thermal energy. The heated air can then be used to heat a home or other structure.
In most cases, the gas valve is controlled by a thermostat. The thermostat senses the temperature of the room and turns the gas valve on or off as needed to maintain the desired temperature.