The other answers are correct. Using electricity usually burns fossil fuels such as coal, and other non renewable fuels.
When burning these fuels they emit pollutants in the air.
Another way is of when the air conditioners aren't properly disposed of such as tossed into the landfill or when someone just cuts a line and releases refrigerant this refrigerant depletes the ozone layer which in turn causes global warming.