Allah Does as He Wills!
Abdullah bin Mas'ud narrates from the Rasul of Allah (Saw):
"The material from your mother and father is collected in your mother’s womb for forty days.
Then in a similar period (forty day) that material turns into a clot of blood.
Then it becomes like a piece of flesh in another similar period.
So it's been 120 days. Then an angel is sent to him and the angel breaths spirit into him.
And the angel is ordered to write four things; His livelihood, his date of death, his deeds and whether he will be of the fortunate ones (said) or the unfortunate ones (shaqi).
I swear by Allah besides whom there is no other:
One of you will engage in the deeds of the people of paradise. Until there is nothing except a cubit between him and Paradise!...
But then what has been written for him will take effect.
And he will begin to engage in the deeds of the people of Hell.
And one of you will engage in the deeds of the people of Hell, until there is nothing except a cubit between him and Hell then what has been written for him will take effect and he will begin to engage in the deeds of the people of Paradise."