Final answer:
Chemical energy in fossil fuels is converted into thermal energy, which is then transformed into mechanical energy and finally into electrical energy.
Step-by-step explanation:
Chemical energy in fossil fuels is converted into thermal energy through reactions like combustion. This thermal energy is used to produce mechanical energy by heating water and producing steam in a boiler. The steam then expands and spins a turbine, which is connected to a generator to produce electrical energy.