1850s: Gravity-based explanations. The sun could be fueled by meteors falling into it from outer space, however, it was realized that this proposal fell short because there simply were not enough meteors available to do the job, nor was there evidence for the consequent sizable increase in solar mass. Another intriguing idea was that the sun was kept hot through consuming whole planets, thus releasing their gravitational energy upon impact with the sun. This proposal also fell short upon closer inspection, nevertheless, the idea that gravitation played a key role in maintaining the sun’s energy output was too attractive to be dropped by many, perhaps because there were no other ideas that were more reasonable at the time (Source).
1860s: The Kelvin-Helmholtz gravitational contraction theory: Kelvin and Helmholtz argued that the weight of the sun’s outer layers (which are cooler than the inner core) can cause the Sun to contract gradually due to gravity, compressing its interior gases, and since compressing a gas increases its temperature, when the gases are hot enough they radiate energy everywhere around the Sun into space. The model of the Sun based on contraction predicts that the age of the Sun is only 25 million years old, but the geological and fossil record shows that the earth is far older than that, ~4.5 billion years old, and since life on earth would not be possible without the Sun, 19th century scientists were facing a mystery.