Fire requires a combination of heat, oxygen, and fuel. Removing any of these elements will extinguish the fire.
For example, covering a fire will remove its oxygen source, extinguishing the fire.
Applying water to a fire removes its heat, extinguishing the fire.