The Messenger of Allah ﷺ, the truthful and trusted, told us, "Each one of you is gathered in his mother's womb for forty days, then becomes a clinging clot for the same period, then becomes a lump of flesh for the same period. Then Allah sends an angel to him with four commands, and he writes down his deeds, his lifespan, his provision, and whether he will be wretched or blessed. Then the soul is breathed into him.A man may perform the deeds of the people of the Fire until there is only an arm's length between him and it, then what was 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 an arm's length between him and it, then what was written overtakes him, so he performs the deeds of the people of the Fire and enters it."
حدثنا عمر بن حفص حدثنا أبي حدثنا الأعمش حدثنا زيد بن وهب حدثنا
حدثنا رسول الله ﷺ وهو الصادق المصدوق إن أحدكم يجمع في بطن أمه أربعين يوما ثم يكون علقة مثل ذلك ثم يكون مضغة مثل ذلك ثم يبعث الله إليه ملكا بأربع كلمات فيكتب عمله وأجله ورزقه وشقي أو سعيد ثم ينفخ فيه الروح فإن الرجل ليعمل بعمل أهل النار حتى ما يكون بينه وبينها إلا ذراع فيسبق عليه الكتاب فيعمل بعمل أهل الجنة فيدخل الجنة وإن الرجل ليعمل بعمل أهل الجنة حتى ما يكون بينه وبينها إلا ذراع فيسبق عليه الكتاب فيعمل بعمل أهل النار فيدخل النار