The Sun is the only source of external heat for the Earth.
Sunlight heats the Earth's surface during the day.
As the Earth's surface warms up it also releases heat, but we cannot see this as light like sunlight from the Sun. Sometimes, on hot days we can see the heat shimmers rising from a hot black road. This shows us that a lot of heat is being given off by the surface. At night, when the surface is no longer heated by the Sun, the Earth continues to give off heat in this way. In fact, at the scale of the whole Earth, as much heat is given off by the Earth as is received by the Sun.