Abdullah bin Masud reported,

The Messenger of Allah ﷺ, the truthful and trustworthy, told us, "Each one of you has his creation gathered in his mother's womb for forty days. Then he becomes a clinging clot for a similar period. Then he becomes a lump of flesh for a similar period. Then the angel is sent to him, who breathes the soul into him and is commanded to record four matters, his provision, his lifespan, his deeds, and whether he will be wretched or blessed.By the One besides whom there is no god, one of you may do the deeds of the people of Paradise until there is only an arm's length between him and it, then what is written overtakes him, and he ends with the deeds of the people of the Fire and enters it. And a man may do the deeds of the people of the Fire until there is only an arm's length between him and it, then what is written overtakes him, and he ends with the deeds of the people of Paradise and enters it."

Ahmad 3624

Sahih

حدثنا أبو معاوية حدثنا الأعمش عن زيد بن وهب

عن عبد الله قال

حدثنا رسول الله ﷺ وهو الصادق المصدق إن أحدكم يجمع خلقه في بطن أمه في أربعين يوما ثم يكون علقة مثل ذلك ثم يكون مضغة مثل ذلك ثم يرسل إليه الملك فينفخ فيه الروح ويؤمر بأربع كلمات رزقه وأجله وعمله وشقي أم سعيد فوالذي لا إله غيره إن أحدكم ليعمل بعمل أهل الجنة حتى ما يكون بينه وبينها إلا ذراع فيسبق عليه الكتاب فيختم له بعمل أهل النار فيدخلها وإن الرجل ليعمل بعمل أهل النار حتى ما يكون بينه وبينها إلا ذراع فيسبق عليه الكتاب فيختم له بعمل أهل الجنة فيدخلها

أحمد 3624صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abdullah bin Masud
Numbering
Darussalam 3624
Ahmad 3624