As-Salaam alaikum,
Ibn Umar, may Allah be pleased with him, narrated that the Prophet, Sallallahu alaihi Wasallam, said:--

"Allah created creation in a darkness (fi zulmatin); then He cast upon
them from His Light. Whoever was touched by that Light, he is guided,
and whoever was missed by it is misguided. Therefore, I say that the
Pen is dry (and all is) in Allah's Knowledge."
(Reported by: Tirmidhi, Ahmad, Bayhaqi, al-Hakim and Tabarani)

Abdullah Ibn Amr, may Allah be pleased with him, narrated:-

"I heard Allah's Messenger Sallallahu alaihi Wasallam, saying: 'Verily Allah
created the elements of man in darkness and then He infused into them His
Light. He who received this light (and then made use of it) received the right
guidance and he who erred was led astray. That is why I say that the Pen has
no more to write about Allah's Knowledge."
(Ahmad and Tirmidhi).

Commenting on this hadith in his work, 'Aridat al-ahwadhi (10:108)', Ibn Arabi al-Maliki observed that "it is clear from it that each one receives of that Light to the extent of what he has been granted out of the general and the specific... in the heart and in the limbs."