"So among them are the wretched and the happy." (Qur'an 11:105)
Yahya narrated from Fitr, from Abu al-Tufayl, who said: I heard Abdullah ibn Mas'ud say: The Messenger of Allah (peace and blessings of Allah be upon him) said: "Indeed, the creation of one of you is gathered in his mother's womb for forty days as a nutfah (drop), then he is a clot (alaqah) for forty days, then he is a lump of flesh (mudghah) for forty days. Then, the angel is sent, and he is commanded to record four things: his provision, his deed, his lifespan, and his trace (end result), and whether he is wretched or happy. By the One besides whom there is no god, indeed one of you may perform the deeds of the people of Paradise until there is only a cubit between him and Paradise, then the decree overtakes him, and he performs the deeds of the people of Hell and enters it; and indeed one of you may perform the deeds of the people of Hell until there is only a cubit between him and the Fire, then the decree overtakes him, and he performs the deeds of the people of Paradise and enters it."
﴿فَمنهمْ شقي وَسَعِيد﴾.
يحيى: عَنْ فِطْرٍ، عَنْ أَبِي الطُّفَيْلِ قَالَ:
سَمِعْتُ عَبْدَ اللَّهِ بْنَ مَسْعُودٍ يَقُولُ: قَالَ رَسُولُ اللَّهِ ﷺ: " إِنَّ خَلْقَ أَحَدِكُمْ يُجْمَعُ فِي بَطْنِ أُمِّهِ أَرْبَعِينَ يَوْمًا نُطْفَةً، ثُمَّ يَكُونُ أَرْبَعِينَ يَوْمًا عَلَقَةً، ثُمَّ يَكُونُ أَرْبَعِينَ يَوْمًا مُضْغَةً، ثُمَّ يَبْعَثُ الْمَلَكَ فَيُؤْمَرُ أَنْ يَكْتُبَ أَرْبَعًا: رِزْقَهُ وَعَمَلَهُ وَأَجَلَهُ وَأَثَرَهُ، وَشَقِيًّا أَوْ سَعِيدًا. وَالَّذِي لَا إِلَهَ غَيْرُهُ؛ إِنَّ الْعَبْدَ لَيَعْمَلُ بِعَمَلِ أَهْلِ الْجَنَّةِ حَتَّى لَا يَكُونُ بَيْنَهُ وَبَيْنَ الْجَنَّةِ إِلا ذراعٌ؛ فَيَسْبِقُ عَلَيْهِ الْكِتَابُ فَيَعْمَلُ بِعَمَلِ أَهْلِ النَّارِ حَتَّى يَدْخُلَهَا، وَإِنَّ الْعَبْدَ لَيَعْمَلُ بِعَمَلِ أَهْلِ النَّارِ حَتَّى لَا يَكُونُ بَينه وَبَين النَّار إِلا ذراعٌ؛ فَيَسْبِقُ عَلَيْهِ الْكِتَابُ فَيَعْمَلُ بِعَمَلِ أَهْلِ الْجَنَّةِ فَيَدْخُلَهَا ".