Fossil fuels such as coal, gas and oil are derived from crude oil.
These fuels are hydrocarbons, but also include impurities such as sulfur.
When the fuels are burned, sulfur dioxide is produced which can escape into the atmosphere:
S (s) + O₂ (g) → SO₂ (g)