Water cools the combustible material and the temperature is brought below the ignition temperature of the combustible material . This prevents fire from spreading. Water vapours also surround the combustible material and help in cutting off the air supply.
Water can be used when solid materials like paper, wood etc. are on fire. However, it is not suitable for extinguishing fire in electrical appliances. If water is poured on an electrical fire, it can conduct electricity and cause electric shocks to the person trying to extinguish the fire. Moreover, water should not be used in fires involving hot cooking oil or fat because it can spread such fires.