Here is how the sun can affect the earth,
The sun affects the earth by its gravity, which keeps earth in orbit, and by raising tides in the rocky and watery components of the earth. And on the obvious side, it keeps the earth from becoming cold at times.