Malbim Ayelet HaShachar Klal 598
Can copy this into an AI, or connect the whole library to your assistant. For deeper learning, you can directly use the original seforim, sites, and apps.
מלת "ויהי" מורה שנעשה איזה פעל רשום (שמיני סימן טו)
Ayelet Hashachar, translated by Betzalel Avraham Feinstein, 2021
The word ויהי (and there was) teaches that whatever action that was written was done.
Genesis 1:3 says, ויאמר אלהים יהי אור ויהי אור (And God said: 'Let there be light.' And there was light), using the word ויהי to teach that God’s action of creating light was done.