Coal is usually burned to create heat. This heat is used to turn water into superheated steam. The steam is then used to turn a turbine which is connected to a generator which creates electricity. So basically the thermal energy from the coal is converted to rotational energy in the turbine. Then the rotational energy is converted into electrical energy in the generator.