The Earth received energy in the form of radiation from the Sun. For the Earth to remain in balance the energy coming into and leaving the Earth must equal. See on figure below.
We can explain it in another ways, that medium between the Sun and Earth perform a resistance, that’s why the Earth doesn’t fall to the Sun and burn up, but it cause the force of sideways that works on the medium.