In v. 14 God does not say, Let there be lights . . . to separate, as if there were no lights before this command and afterward the lights were created. Rather the Hebrew text reads, And God said, ‘Let the lights in the expanse of the sky separate.’ In other words . . . God’s command assumes the lights were already in the expanse and that in response to his command they were given a purpose, to separate the day from the night and to mark seasons and days and years.. . . It suggests that the author did not understand his account of the fourth day as the creation of lights; but, on the contrary, the narrative assumes that the heavenly lights had already been created in the beginning (John H. Sailhamer, Expositors Bible Commentary, Vol. 2, Frank E. Gaebelein General Editor, Grand Rapids Mi: Zondervan, 1990, p. 34). See: https://www.blueletterbible.org/faq/don_stewart/don_stewart_684.cfm