To obtains the energy in fossil fuels you burn it. This releases CO2, which travels to the atmosphere and contribute to the greenhouse effect. One overall consequence of this is the increase of themperature, which in turn melts the ice on the poles. The ocean level increases and the weather gets unstable. All the burning of fossil fuels also make the air quality bad. You can see examples of this some places in China, where the air is poisonous.