The bit of the solar system with the Earth in it is like this.....
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.
Let's have a closer look at the relationship between our star, the Sun, our planet Earth and our nearest satellite: the moon.