The Fourth Day of creation as recorded in Genesis 1:14-19 was written to a people prone to worship the sun, moon, and stars so that they can see that these things are not gods but are simply one part of God’s good creation. The proclivity of human beings of every age is to exchange the truth about God for a lie, and worship and serve the creature rather than the Creator (see Rom. 1:18-25). As Moses writes Against the gods, he reveals who the only true God is and how he actually constructed the material universe in which we live. It is important to note the way in which the Bible undermines other worldviews: it provides us with a revelation of the reality of the world in which we live, its true historical origins, and at some points in history even the order of events. The Bible records are a historically reliable account of what occurred in time-space reality, and the history presented to us is not figurative.
Some point to 1) the creation of light (Gen 1:3) before the creation of the luminaries which produce light (v.14-19) and 2) the existence of plant life (v.11-13) before the sun (v.14-19) as clues for us to take this entire creation week as figurative. Basically, how can light exist before the sun? For the answer, I would like to point you back to the first sermon in the Genesis series to see a reference to another source of light besides the sun. Speaking of God’s character, 1 John 1:5 says “God is light; in him there is no darkness at all”, but this light materially appears throughout Israel’s history: God’s glory cloud lights up the way for the Israelites (Exodus 13:21-22); this light leaves a physical impression on the skin of Moses causing it likewise to shine (Exodus 34:29); referring back to Genesis, John says that Jesus’s light shone in the darkness as the light of the world (John 1:5; 8:12); this light also makes a physical appearance as seen in Jesus’s transfiguration (Mark 9:2–13; Matthew 17:1–13; Luke 9:28–36) as the light of Jesus's own divine glory. The light is the glory of God materially shining into the universe, a theophany of God’s glory, a task delegated to luminaries on the fourth day of creation. What an amazing God we worship!