Basically the earths center is hot and can convert water into steam. The steam creates enough pressure to rotate a turbine. The turbine is attached to a generator to be converted to electricity. And the remaining steam is cooled and condenses into water and reused.