what does the bible say?
Genesis 1 shows that a form of light permeated creation from the first day even before the sun was created. The sun, moon, and stars were given their purposes on day four (Genesis 1:14-19), serving as ongoing markers for humanity rather than the initial source of light.
While we can't be certain of the initial light source, many possibilities have been proposed. One possibility is that the light on the first three days was a temporary protosun (i.e., protostar). A second explanation is that the light on the first day (Genesis 1:3) was a direct act of divine creation, with God Himself as the source. God does not need the sun, moon, and stars to provide light (Revelation 21:23). A third possibility is that the nearest star, our sun, was created on day one along with the other stars and celestial bodies ("the heavens" of Genesis 1:1). But these light sources were not yet visible to an observer on earth, due to the initial cloud cover. The "making" of the sun on day four refers to its functional appearance and role in the earth's environment, not its physical creation, which took place on day one with the other stars.