Carbon dioxide is obtained by chemical reaction or kept under pressure is used in fire extinguishers.
They are not that corrosive and are non-conductors of electricity. Hence, they are used when electronic and electric equipments catches fire.
The liquid and solid carbon dioxide is filled under pressure in modern extinguishers. If the pressure is reduced, it becomes gaseous and bursts out through the horn-like hose pipe.