How has the inside of the Earth stayed as hot as the Sun’s surface for billions of years?

How has the inside of the Earth stayed as hot as the Sun’s surface for billions of years?