Abdullah bin Masud reported,

The Messenger of Allah ﷺ, who is the truthful and trusted, narrated to us, saying, "Each one of you is gathered together in his mother's womb for forty days, then becomes a clinging clot for a similar period, then becomes a lump of flesh for a similar period. Then Allah sends an angel who is commanded with four matters, to record his provision, his lifespan, and whether he will be wretched or blessed. By Allah, one of you, or a man, may perform the deeds of the people of the Fire until there is only an arm's length or a cubit between him and it, then what is written overtakes him, so he performs the deeds of the people of Paradise and enters it. And a man may perform the deeds of the people of Paradise until there is only a cubit or two between him and it, then what is written overtakes him, so he performs the deeds of the people of the Fire and enters it."Adam said, "Except a cubit."

Bukhari 6594

Sahih

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

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

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

البخاري 6594صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Decree
Chapter
Decree
Numbering
Darussalam 6594
Bukhari 6594