How does the sun get hotter?

Main sequence stars like the Sun actual grow cooler with age. But solar heating of the planet can be increased by several factors on both the Sun and the Earth.