The creation of man and the decree
رَوَاهُ الْبُخَارِيُّ وَمُسْلِمٌ.
On the authority of Abu Abd ar-Rahman Abdullah ibn Mas'ud (may Allah be pleased with him), who said: “The Messenger of Allah (may Allah bless him and grant him peace), and he is the truthful and the trusted, narrated to us: "Truly, each one of you is formed in his mother's womb for forty days as a drop of seed, then he remains there as a clot of blood for the like of that, and then as a lump of flesh for the like of that. Then Allah sends to him an angel who breathes the spirit into him and is commanded with four matters: his provision, his deeds, the term of his life, and whether he will be wretched or blessed. And by Him besides Whom there is no god worthy of worship, one of you may do the deeds of the people of Paradise until there is but a cubit between him and it, and then the decree overtakes him and he does the deeds of the people of the Fire and enters it. And one of you may do the deeds of the people of the Fire until there is but a cubit between him and it, and then the decree overtakes him and he does the deeds of the people of Paradise and enters it."
Related by al-Bukhari and Muslim.
[al-Bukhari 3208; Muslim 2643]