Here's how it works:
* Earth rotates on its axis: Earth spins on its axis, completing one full rotation about every 24 hours. This rotation is from west to east.
* Perspective: As the Earth rotates eastward, it carries us along with it. From our perspective on Earth, it looks like the Sun is moving westward across the sky. It's similar to sitting on a moving train and seeing the trees outside your window moving in the opposite direction.
* Sunrise and Sunset: Because of the Earth's rotation, the Sun appears to rise in the east (when our location faces the Sun) and sets in the west (when our location turns away from the Sun).
So, while the Sun seems to move across the sky, it's actually the Earth spinning that creates this illusion.