Isaac Newton studied math and the nature of light and gravitation at Trinity College in Cambridge. He was inspired by the discoveries made by people like Johannes Kepler, Robert Boyle, Galileo Galilei and Nicolaus Copernicus.
Regarding the theory of Galileo Galilei, which argues that planets revolve around the sun, not the earth. Newton thought that the universe worked as if it was a machine and it then would mantain itself with simple laws. He claimed that mathematics was the best way to prove those laws.
The Copernican heliocentric theory was not accepted by the public, scientific or otherwise. Isaac Newton, however, was the most famous supporter of this theory and even helped to explain the force of gravity.
Hope this helps! <3