Water works as a fire extinguisher by removing
heat and oxygen
Water removes heat and cuts off the supply of oxygen when it is used as a fire extinguisher.
Water cools the combustible material so that its temperature is brought below its ignition temperature. This prevents the fire from spreading. Water vapours also surround the combustible material, helping in cutting off the supply of air so that the fire is exhausted. But water cannot be used for fires involving electrical equipment and inflammable substances.