Oxygen, heat, and fuel are frequently referred to as the "fire triangle." Add in the fourth element, the chemical reaction, and you actually have a fire "tetrahedron." The important thing to remember is: take any of these four things away, and you will not have a fire or the fire will be extinguished.
Essentially, fire extinguishers put out fire by taking away one or more elements of the fire triangle/tetrahedron.