Hadith 6178
Sayyiduna Abdullah bin Umar (may Allah be pleased with them) narrates that the Prophet Muhammad (peace and blessings be upon him) said: "When Allah Almighty intends to create a soul, the angel appointed over the womb says, 'O Lord! Will it be a boy or a girl?' So Allah Almighty makes His decision known. Then the angel says, 'O Lord! Will he be wretched or blessed?' So Allah Almighty makes His decision known regarding that. Then the angel writes between his two eyes all those things which that person (when he grows up) will face, even to the extent that the stumbling he will encounter (that too is written down)."