Abdullah bin Mas'ud said:
The Messenger of Allah (ﷺ), the true and truly inspired one, told us that: 'The creation of one of you is put together in his mother's womb for forty days, then it becomes a clot for a similar length of time, then it becomes a chewed lump of flesh for a similar length of time. Then Allah sends the angel to him and commands him to write down four things. He says: Write down his deeds, his life span, his provision, and whether he is doomed (destined for Hell) or blessed (destined for Paradise). By the One in Whose Hand is my soul! One of you may do the deeds of the people of Paradise until there is no more than a forearm's length between him and it, then the decree overtakes him and he does the deeds of the people of Hell until there is no more than a forearm's length between him and it, then the decree overtakes him and he does the deeds of the people of Paradise until he enters therein.