Our planet Earth undergoes two vital process namely:
1. ROTATION: The Earth rotates continuously on its own axis which is slightly tilted and this mechanism is termed as Rotation, rotation of the earth enables the change of day to night and vice versa.
2. REVOLUTION: The movement of Earth in its own orbit around the sun is termed as revolution, the process of revolution is responsible for the changes of various seasons throughout the year.
The sun is fixed and does not move at it is the Earth which moves through rotation and revolution simultaneously. Both sun and the Earth are spherical in shape, the Sun is the only source of light which makes the difference between day and night. But as it is fixed so it is impossible to provide light to all of the Earth at the same time. During rotation the part of the Earth which faces the sun constitutes of the day period and the part which is abandoned faces night. Every 12 hours one part of the Earth faces the Sun and thus enjoy their daytime where as the other part faces the sun.
So the Sun does not go anywhere when it is dark it is the Earth which moves.