There are a variety of gas sensors which vary in their:
- sensing technique,
- ability to discriminate between gases (cross sensitivity),
- power consumption (due to heater / light source),
- susceptibility to reversible ill effects and permanent ones (poisoning),
- degradation over time and prescribed lifetime.
Some sensors use a heating element which heats the sensor and a tiny volume of air to a very high temperature - these will use a metal wire gauze (mesh) for the same reason as the Davy lamp (Wikipedia).
These use a heated, ceramic bead impregnated with metal oxide (often tin dioxide) as a variable resistor. Broadly speaking, the resistance drops in the presence of gases which can be oxidised.
The MQ series are popular with hobbyists in the Arduino community. There's an interesting look inside an MQ-2 on Learn the Working of a Gas Sensor.
These have two heated elements, one which catalyses oxidation of gases and one which doesn't to act as a reference resistance. A catalyst is defined as something which is not consumed in the reaction but traditional designs for catalytic sensors can age in unfortunate ways according to Figaro Engineering.
These are essentially a battery where a gas is required to complete the chemical reaction to produce a tiny current. These may or may not be heated depending on the type/sensitivity. These are likely to have a time or exposure limited life.
This is a sensor from a commercial, domestic carbon monoxide (CO) detector which has reached its enforced end-of-life. Note: "CAUTION ACID" written on the sensor indicating a property of its cell chemistry, probably sulphuric acid.
Another common example is the small button battery based on the zinc-air cell used in hearing aids. These look like normal button cells but have an extra tab which is removed at installation time to expose the cell to the oxygen in the air.
These determine the gas based on absorption at a particular wavelength and are sometimes referred to as Non-dispersive Infrared (NDIR) sensors.
See DFRobot's Analog Infrared CO2 Sensor For Arduino for an example. This looks like it's based on sensor on the Winsen MH-714A gas sensor module which has a strong resemblance to the Telaire T6613/T6615 CO2 sensor modules.
Miners working underground are often at risk from both poisonous and explosive gases. Canaries were the traditional solution to detecting poisonous gases. For some history, see Smithsonian Magazine: The Story of the Real Canary in the Coal Mine.