Verily your creation is on this wise. The constituents of one of you are collected for forty days in his mother's womb in the form of blood, after which it becomes a clot of blood in another period of forty days. Then it becomes a lump of flesh and forty days later Allah sends His angel to it with instructions concerning four things, so the angel writes down his livelihood, his death, his deeds, his fortune and misfortune. By Him, besides Whom there is no god, that one amongst you acts like the people deserving Paradise until between him and Paradise there remains but the distance of a cubit, when suddenly the writing of destiny overcomes him and he begins to act like the denizens of Hell and thus enters Hell, and another one acts in the way of the denizens of Hell, until there remains between him and Hell a distance of a cubit that the writing of destiny overcomes him and then he begins to act like the people of Paradise and enters Paradise. (Using translation from Muslim 2643a)
حَدَّثَنَا رَسُولُ اللهِ ﷺ وَهُوَ الصَّادِقُ الْمَصْدُوقُ إِنَّ أَحَدَكُمْ يُجْمَعُ خَلْقُهُ فِي بَطْنِ أُمِّهِ فِي أَرْبَعِينَ يَوْمًا ثُمَّ يَكُونُ عَلَقَةً مِثْلَ ذَلِكَ ثُمَّ يَكُونُ مُضْغَةً مِثْلَ ذَلِكَ ثُمَّ يُرْسَلُ إِلَيْهِ الْمَلَكُ فَيَنْفُخُ فِيهِ الرُّوحَ وَيُؤْمَرُ بِأَرْبَعِ كَلِمَاتٍ رِزْقِهِ وَأَجَلِهِ وَعَمَلِهِ وَشَقِيٌّ أَمْ سَعِيدٌ فَوَالَّذِي لَا إِلَهَ غَيْرُهُ إِنَّ أَحَدَكُمْ لَيَعْمَلُ بِعَمَلِ أَهْلِ الْجَنَّةِ حَتَّى مَا يَكُونُ بَيْنَهُ وَبَيْنَهَا إِلَّا ذِرَاعٌ فَيَسْبِقُ عَلَيْهِ الْكِتَابُ فَيُخْتَمُ لَهُ بِعَمَلِ أَهْلِ النَّارِ فَيَدْخُلُهَا وَإِنَّ الرَّجُلَ لَيَعْمَلُ بِعَمَلِ أَهْلِ النَّارِ حَتَّى مَا يَكُونُ بَيْنَهُ وَبَيْنَهَا إِلَّا ذِرَاعٌ فَيَسْبِقُ عَلَيْهِ الْكِتَابُ فَيُخْتَمُ لَهُ بِعَمَلِ أَهْلِ الْجَنَّةِ فَيَدْخُلُهَا