Carbon dioxide is heavier than air and does not support combustion. Carbon dioxide extinguishes fire by displacing oxygen or by taking away oxygen from the fire triangle.
Carbon dioxide is also very cold when it comes out of the extinguisher.
Thus, it reduces the temperature of the fuel as well.