Think of a pot of boiling water. The burner makes the heat, the heat rises, and the cold water replaces it, then the cold water gets hotter and rises. It's a cycle
Heat is transferred by convection within the liquid outer core and in the mantle. Convection in the mantle is caused by cooling of rock near the crust, which then sinks back into the lower mantle...