Earth’s rotation is a side effect of the formation of our solar system, which started as a massive cloud of gas and dust roughly 4.6 billion years ago. The cloud began to rotate as it scrunched together under its own gravity. The material at the center eventually become the sun, while whirlpools of dust and gas farther out spun faster and faster until they formed into planets. With nothing to stop its spinning motion, Earth retained the rotation from its early days.
Picture Credit : Google