The Earth and the moon orbit the sun. The moon orbits the Earth.
Scientists understand the movement of the Earth and moon in space because of the effects that spinning and orbiting have here on Earth. For example: day and night and the seasons.
Without the heat and light from our nearest star, the sun, there would not be life on Earth as we know it.