וַיֹּ֥אמֶר אֱלֹהִ֖ים יְהִ֣י א֑וֹר וַֽיְהִי־אֽוֹר׃
Lalu Allah berfirman, “Jadilah terang!” Maka jadilah terang.
Chizkuni
ויאמר אלוקים, “G-d said:” seeing that there were no intelligent creatures as yet that G-d could have spoken to, the meaning of this statement must be that “G-d spoke to His heart, to the seat of His thoughts.” Even in our physical world nowadays when a human being expresses thoughts verbally, these are products of his thought processes which preceded his thoughts being formulated. If we needed proof for the correctness of this approach, the reader only needs to look at Genesis 6,67: וינחם ה' כי עשה את האדם בארץ ויתעצב אל לבו. ויאמר ה׳ אמחה את האדם אשר בראתי וגו', “The Lord became regretful that He had created man on the earth, and His heart was saddened; He said: “I will wipe out the human race on earth, etc.”
Da'at Zekenim
"let there be light" and there was light: And that which [the Torah] did not write, "and it was so," as with the other [days] is because, when it did so with the others, it was written in order to shorten its words; since had it explained all the arrangements of creation, it would have had to have been more expansive, but here there is no more expansiveness in the word (and there was) light (vayehi ohr) than in the word, (and it was) so (vayehi khen).
Rashbam
ויאמר אלוקים יהי אור, by means of this directive G’d meant to correct the fact that up until then everything was in complete darkness,