Messenger of Allah ﷺ the true and truly inspired, narrated to us, "The creation of everyone of you starts with the process of collecting the material for his body within forty days and forty nights in the womb of his mother. Then he becomes a clot of thick blood for a similar period (40 days) and then he becomes like a piece of flesh for a similar period. Then an angel is sent to him (by Allah) and the angel is allowed (ordered) to write four things; his livelihood, his (date of) death, his deeds, and whether he will be a wretched one or a blessed one (in the Hereafter) and then the soul is breathed into him. So one of you may do (good) deeds characteristic of the people of Paradise so much that there is nothing except a cubit between him and Paradise but then what has been written for him decides his behavior and he starts doing (evil) deeds characteristic of the people of Hell (Fire) and (ultimately) enters Hell (Fire); and one of you may do (evil) deeds characteristic of the people of Hell (Fire) so much so that there is nothing except a cubit between him and Hell (Fire), then what has been written for him decides his behavior and he starts doing (good) deeds characteristic of the people of Paradise and ultimately) enters Paradise." (See Hadith No. 430, Vol. 4) (Using translation from Bukhārī 7454)
قَالَ رَسُولُ اللهِ ﷺ وَهُوَ الصَّادِقُ الْمَصْدُوقُ إِنَّ أَحَدَكُمْ يُجْمَعُ خَلْقُهُ فِي بَطْنِ أُمِّهِ أَرْبَعِينَ يَوْمًا ثُمَّ تَكُونُ عَلَقَةً مِثْلَ ذَلِكَ ثُمَّ تَكُونُ مُضْغَةً مِثْلَ ذَلِكَ ثُمَّ يَبْعَثُ اللهُ الْمَلَكَ فَيَنْفُخُ فِيهِ الرُّوحَ ثُمَّ يُؤْمَرُ بِأَرْبَعِ كَلِمَاتٍ كَتْبِ رِزْقِهِ وَعَمَلِهِ وَأَجَلِهِ وَشَقِيٍّ هُوَ أَمْ سَعِيدٍ فَوَالَّذِي لَا إِلَهَ غَيْرُهُ إِنَّ أَحَدَكُمْ لَيَعْمَلُ بِعَمَلِ أَهْلِ النَّارِ حَتَّى مَا يَكُونُ بَيْنَهُ وَبَيْنَهَا إِلَّا ذِرَاعٌ فَيَسْبِقُ عَلَيْهِ الْكِتَابُ فَيُخْتَمُ لَهُ بِعَمَلِ أَهْلِ الْجَنَّةِ فَيَدْخُلُهَا وَإِنَّ أَحَدَكُمْ لَيَعْمَلُ بِعَمَلِ أَهْلِ الْجَنَّةِ حَتَّى مَا يَكُونُ بَيْنَهُ وَبَيْنَهَا إِلَّا ذِرَاعٌ فَيَسْبِقُ عَلَيْهِ الْكِتَابُ فَيُخْتَمُ لَهُ بِعَمَلِ أَهْلِ النَّارِ فَيَدْخُلُهَا