the Messenger of Allah ﷺ, the truthful and truly-inspired, said, "Each one of you is collected in the womb of his mother for forty days, and then turns into a clot similar to it, and turns into a piece of flesh similar to it, and then Allah sends an angel and orders him to write four things: (1) his provision, (2) his age, and (3) whether he will be of the wretched, or (4) ˹he will be of the˺ the blessed.
And by Allah, a person among you or a man may do deeds of the people of the Fire till there is only a cubit or an arm-breadth distance between him and the Fire, but then that decree precedes, and he does the deeds of the people of Paradise and enters it; and a man may do the deeds of the people of Paradise till there is only a cubit or two between him and Paradise, and then that decree precedes it and he does the deeds of the people of the Fire and enters it."
حَدَّثَنَا رَسُولُ اللَّهِ ﷺ وَهْوَ الصَّادِقُ الْمَصْدُوقُ قَالَ: «إِنَّ أَحَدَكُمْ يُجْمَعُ فِي بَطْنِ أُمِّهِ أَرْبَعِينَ يَوْمًا, ثُمَّ عَلَقَةً مِثْلَ ذَلِكَ, ثُمَّ يَكُونُ مُضْغَةً مِثْلَ ذَلِكَ, ثُمَّ يَبْعَثُ اللَّهُ مَلَكًا فَيُؤْمَرُ بِأَرْبَعٍ: (١) بِرِزْقِهِ، (٢) وَأَجَلِهِ، (٣) وَشَقِيٌّ، أَوْ (٤) سَعِيدٌ۔
فَوَاللَّهِ إِنَّ أَحَدَكُمْ أَوِ الرَّجُلَ يَعْمَلُ بِعَمَلِ أَهْلِ النَّارِ حَتَّى مَا يَكُونُ بَيْنَهُ وَبَيْنَهَا غَيْرُ بَاعٍ أَوْ ذِرَاعٍ فَيَسْبِقُ عَلَيْهِ الْكِتَابُ فَيَعْمَلُ بِعَمَلِ أَهْلِ الْجَنَّةِ فَيَدْخُلُهَا، وَإِنَّ الرَّجُلَ لَيَعْمَلُ بِعَمَلِ أَهْلِ الْجَنَّةِ حَتَّى مَا يَكُونُ بَيْنَهُ وَبَيْنَهَا غَيْرُ ذِرَاعٍ أَوْ ذِرَاعَيْنِ فَيَسْبِقُ عَلَيْهِ الْكِتَابُ فَيَعْمَلُ بِعَمَلِ أَهْلِ النَّارِ فَيَدْخُلُهَا۔»