Carbon dioxide is stored in liquid form in a fire extinguisher.
When it is released it expands rapidly and covers the entire area like a blanket and disconnects the supply of oxygen to fire, which is the supporter of combustion.
Also, carbon dioxide has a much lower temperature, so when it covers the fire it brings down the temperature rapidly thereby extinguishing the fire.