In order to have a fire, there must be three elements:
Fuel: something which will burn
Heat: enough to make the fuel burn
Oxygen: air
All three elements must be present at the same time to have a fire. Fire will burn until one or more of the elements is removed, then the fire will go out.