Ghetto_Ghost wrote:
if it helps, think of the earth as a pizza.

Yeah, I'm sure that helps explain why the Earth's core is hot.
The core is hot for two reasons:
1: heat remaining from the formation of the planet
2: decay of radioactive elements (potassium, thorium and uranium)
Without the latter, the earth would become covered in water and we'd all die.