\(CO_2\), being heavier than oxygen, covers the fire like a blanket.
Since the contact between the fuel and oxygen is cut off, the fire is controlled.
\(CO_2\) is a non-combustible gas and it is also non-supporter of combustion, thus it extinguishes fire.
Read more: Carbon Dioxide