This is only a problem if we fail to take into account an infinite and omnipotent God. God does not need the sun, moon, and stars to provide light. God is light! First John 1:5 declares, "This is the message we have heard from him and declare to you: God is light; in Him there is no darkness at all." God Himself was the light for the first three days of Creation, just as He will be in the new heavens and new earth, “There will be no more night. They will not need the light of a lamp or the light of the sun, for the Lord God will give them light. And they will reign for ever and ever” (Revelation 22:5). Until He created the sun, moon, and stars, God miraculously provided light during the “day” and may have done so during the “night” as well (Genesis 1:14).
Jesus said, “I am the light of the world. Whoever follows me will never walk in darkness, but will have the light of life” (John 8:12). Much more important than the light of day and night is the Light who provides eternal life to all who believe in Him. Those who do not believe in Him will be doomed to “outer darkness where there is weeping and gnashing of teeth” (Matthew 8:12).