Abdullah bin Masud reported,

The Messenger of Allah ﷺ, the truthful and trusted one, told us, "Each one of you has his creation gathered together in his mother's womb for forty days. Then he becomes a clinging clot for a similar period, then a lump of flesh for a similar period. Then Allah sends an angel who is commanded with four matters. He is told to write down his deeds, his provision, his lifespan, and whether he will be wretched or blessed. Then the soul is breathed into him..." and the rest of the hadith.

Azami 12773

Sahih

عن عبد الله بن مسعود

حدثنا رسول الله ﷺ، وهو الصادق المصدوق، قال: إن أحدكم يجمع خلقه في بطن أمه أربعين يوما، ثم يكون علقة مثل ذلك، ثم يكون مضغة مثل ذلك، ثم يبعث الله ملكا، فيؤمر بأربع كلمات ويقال له: اكتب عمله، ورزقه، وأجله، وشقي أو سعيد. ثم ينفخ فيه الروح… الحديث.

الأعظمي 12773صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Tafsir of Surah Anbiya
Section
His saying, "doon the people, then wish for death if you are truthful"
Numbering
Jami al-Kamil 12773 (2nd edition)
Azami 12773