Newton’s laws first appeared in his masterpiece, Philosophiae Naturalis Principia Mathematica (1687), commonly known as the Principia. In 1543 Nicolaus Copernicus suggested that the Sun, rather than Earth, might be at the centre of the universe. In the intervening years Galileo, Johannes Kepler, and Descartes laid the foundations of a new science that would both replace the Aristotelian worldview, inherited from the ancient Greeks, and explain the workings of a heliocentric universe. In the Principia Newton created that new science.
He developed his three laws in order to explain why the orbits of the planets are ellipses rather than circles, at which he succeeded, but it turned out that he explained much more. The series of events from Copernicus to Newton is known collectively as the Scientific Revolution.
In the 20th century Newton’s laws were replaced by quantum mechanics and relativity as the most fundamental laws of physics. Nevertheless, Newton’s laws continue to give an accurate account of nature, except for very small bodies such as electrons or for bodies moving close to the speed of light. Quantum mechanics and relativity reduce to Newton’s laws for larger bodies or for bodies moving more slowly.