كتاب القدر
46  
The Book of Destiny
(1)
Chapter: How The Human Being Is Created, In His Mother's Womb, And His Provision, Lifespan And Deeds Are Written Down, And His Misery and Happiness
(1)
بَاب كَيْفِيَّةِ خَلْقِ الْآدَمِيِّ فِي بَطْنِ أُمِّهِ وَكِتَابَةِ رِزْقِهِ وَأَجَلِهِ وَعَمَلِهِ وَشَقَاوَتِهِ وَسَعَادَتِهِ
Sahih Muslim 2646

Anas b. Malik reported directly from Allah's Messenger (ﷺ) that he said:

Allah, the Exlated and Glorious, has appointed an angel as the caretaker of the womb, and he would say: My Lord, it is now a drop of semen; my Lord, It is now a clot of blood; my Lord, it has now become a lump of flesh, and when Allah decides to give it a final shape, the angel says: My Lord, would it be male or female or would he be an evil or a good person? What about his livelihood and his age? And it is all written as he is in the womb of his mother.
حَدَّثَنِي أَبُو كَامِلٍ، فُضَيْلُ بْنُ حُسَيْنٍ الْجَحْدَرِيُّ حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، حَدَّثَنَا عُبَيْدُ، اللَّهِ بْنُ أَبِي بَكْرٍ عَنْ أَنَسِ بْنِ مَالِكٍ، وَرَفَعَ الْحَدِيثَ، أَنَّهُ قَالَ ‏ "‏ إِنَّ اللَّهَ عَزَّ وَجَلَّ قَدْ وَكَّلَ بِالرَّحِمِ مَلَكًا فَيَقُولُ أَىْ رَبِّ نُطْفَةٌ أَىْ رَبِّ عَلَقَةٌ أَىْ رَبِّ مُضْغَةٌ ‏.‏ فَإِذَا أَرَادَ اللَّهُ أَنْ يَقْضِيَ خَلْقًا - قَالَ - قَالَ الْمَلَكُ أَىْ رَبِّ ذَكَرٌ أَوْ أُنْثَى شَقِيٌّ أَوْ سَعِيدٌ فَمَا الرِّزْقُ فَمَا الأَجَلُ فَيُكْتَبُ كَذَلِكَ فِي بَطْنِ أُمِّهِ ‏"‏ ‏.‏
Reference : Sahih Muslim 2646
In-book reference : Book 46, Hadith 8
USC-MSA web (English) reference : Book 33, Hadith 6397
  (deprecated numbering scheme)
Sahih Muslim 2647 a

Ali reported:

We were in a funeral in the graveyard of Gharqad when Allah's Messenger (ﷺ) came to us and we sat around him. He had a stick with him. He lowered his head and began to scratch the earth with his stick, and then said: There is not one amongst you whom a seat in Paradise or Hell has not been allotted and about whom it has not been written down whether he would be an evil person or a blessed person. A person said: Allah's Messenger, should we not then depend upon our destiny and abandon our deeds? Thereupon he said: Acts of everyone will be facilitated in that which has been created for him so that whoever belongs to the company of the blessed will have good works made easier for him and whoever belongs to the unfortunate ones will have evil acts made easier for him. He then recited this verse (from the Qur'an): "Then, who gives to the needy and guards against evil and accepts the excellent (the truth of Islam and the path of righteousness it prescribes), We shall make easy for him the easy end and who is miserly and considers himself above need, We shall make easy for him the difficult end" (xcii. 5-10).
حَدَّثَنَا عُثْمَانُ بْنُ أَبِي شَيْبَةَ، وَزُهَيْرُ بْنُ حَرْبٍ، وَإِسْحَاقُ بْنُ إِبْرَاهِيمَ، - وَاللَّفْظُ لِزُهَيْرٍ - قَالَ إِسْحَاقُ أَخْبَرَنَا وَقَالَ الآخَرَانِ، حَدَّثَنَا جَرِيرٌ، عَنْ مَنْصُورٍ، عَنْ سَعْدِ بْنِ عُبَيْدَةَ، عَنْ أَبِي عَبْدِ الرَّحْمَنِ، عَنْ عَلِيٍّ، قَالَ كُنَّا فِي جَنَازَةٍ فِي بَقِيعِ الْغَرْقَدِ فَأَتَانَا رَسُولُ اللَّهِ صلى الله عليه وسلم فَقَعَدَ وَقَعَدْنَا حَوْلَهُ وَمَعَهُ مِخْصَرَةٌ فَنَكَّسَ فَجَعَلَ يَنْكُتُ بِمِخْصَرَتِهِ ثُمَّ قَالَ ‏"‏ مَا مِنْكُمْ مِنْ أَحَدٍ مَا مِنْ نَفْسٍ مَنْفُوسَةٍ إِلاَّ وَقَدْ كَتَبَ اللَّهُ مَكَانَهَا مِنَ الْجَنَّةِ وَالنَّارِ وَإِلاَّ وَقَدْ كُتِبَتْ شَقِيَّةً أَوْ سَعِيدَةً ‏"‏ ‏.‏ قَالَ فَقَالَ رَجُلٌ يَا رَسُولَ اللَّهِ أَفَلاَ نَمْكُثُ عَلَى كِتَابِنَا وَنَدَعُ الْعَمَلَ فَقَالَ ‏"‏ مَنْ كَانَ مِنْ أَهْلِ السَّعَادَةِ فَسَيَصِيرُ إِلَى عَمَلِ أَهْلِ السَّعَادَةِ وَمَنْ كَانَ مِنْ أَهْلِ الشَّقَاوَةِ فَسَيَصِيرُ إِلَى عَمَلِ أَهْلِ الشَّقَاوَةِ ‏"‏ ‏.‏ فَقَالَ ‏"‏ اعْمَلُوا فَكُلٌّ مُيَسَّرٌ أَمَّا أَهْلُ السَّعَادَةِ فَيُيَسَّرُونَ لِعَمَلِ أَهْلِ السَّعَادَةِ وَأَمَّا أَهْلُ الشَّقَاوَةِ فَيُيَسَّرُونَ لِعَمَلِ أَهْلِ الشَّقَاوَةِ ‏"‏ ‏.‏ ثُمَّ قَرَأَ ‏{‏ فَأَمَّا مَنْ أَعْطَى وَاتَّقَى * وَصَدَّقَ بِالْحُسْنَى * فَسَنُيَسِّرُهُ لِلْيُسْرَى * وَأَمَّا مَنْ بَخِلَ وَاسْتَغْنَى * وَكَذَّبَ بِالْحُسْنَى * فَسَنُيَسِّرُهُ لِلْعُسْرَى‏}
Reference : Sahih Muslim 2647a
In-book reference : Book 46, Hadith 9
USC-MSA web (English) reference : Book 33, Hadith 6398
  (deprecated numbering scheme)