Different extinguishers remove at least one of these three components, thus extinguishing the fire:
Dry Powder
This type of extinguisher is usually rated for multiple purpose use (Class A, Class B, Class C and electrical fires), although their use indoors is not recommended.
These contain a powder based extinguishing agent, this smothers the fire removing oxygen and alters its chemical composition.
Water
Suitable only for use on Class A fires (freely burning carbonaceous materials such as wood, paper and fabrics).
These extinguishers contain water (and sometimes a special additive) and these cause rapid cooling, reducing heat from the fire.
Foam
Suitable for use on Class A and Class B fires (freely burning carbonaceous materials such as wood, paper and fabrics and flammable liquids).
These extinguishers are water based with a special additive and these cause rapid cooling, reducing heat from the fire, but the special foam additive also removes oxygen too.
Carbon Dioxide Primarily designed for use on electrical fires, but suitable for use on flammable liquids fires, these displace oxygen, reducing levels to an extent where a flame cannot be sustained.