Abdullah bin Amr bin As reported,

I heard the Messenger of Allah ﷺ say, "Allah عز وجل created His creation in darkness, then cast upon them some of His light on that day. Whoever was struck by His light on that day was guided, and whoever was missed by it went astray. That is why I say, the pen has dried upon the knowledge of Allah عز وجل."

Azami 12317

Sahih

عن عبد الله بن عمرو قال

سمعت رسول الله ﷺ يقول: إن الله عز وجل خلق خلقه في ظلمة، ثم ألقى عليهم من نوره يومئذ، فمن أصابه من نوره يومئذ اهتدى، ومن أخطأه ضل، فلذلك أقول: جف القلم على علم الله عز وجل.

الأعظمي 12317صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "Is one who was dead and We gave him life and made for him light by which to walk among the people like one who is in darkness, never to emerge therefrom? Thus it has been made pleasing to the disbelievers that which they were doing"
Numbering
Jami al-Kamil 12317 (2nd edition)
Azami 12317