Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:2:28

How can you disbelieve in Allah when you were lifeless and He brought you to life; then He will cause you to die, then He will bring you ˹back˺ to life, and then to Him you will be returned.  

How do you, people of Mecca, disbelieve in God, when you were dead, semen inside loins, and He gave you life, in the womb and in this world by breathing Spirit into you (the interrogative here is either intended to provoke amazement at their ˹persistent˺ unbelief despite the evidence established, or intended as a rebuke); then He shall make you dead, after your terms of life are completed, then He shall give you life, at the Resurrection, then to Him you shall be returned!, after resurrection, whereupon He shall requite you according to your deeds; and He states, as proof of the Resurrection, when they denied it:
القرآن:٢:٢٨

كَيْفَ تَكْفُرُونَ بِاللَّهِ وَكُنْتُمْ أَمْوَاتًا فَأَحْيَاكُمْ ۖ ثُمَّ يُمِيتُكُمْ ثُمَّ يُحْيِيكُمْ ثُمَّ إِلَيْهِ تُرْجَعُونَ  

{كيف تكفرون} يا أهل مكة {بالله و} قد {كنتم أمواتاً} نطفاً في الأصلاب {فأحياكم} في الأرحام والدنيا بنفخ الروح فيكم، والاستفهام للتعجيب من كفرهم مع قيام البرهان أو للتوبيْخ {ثم يميتكم} عند انتهاء آجالكم {ثم يحييكم} بالبعث {ثم إليه ترجعون} تردون بعد البعث فيجازيكم بأعمالكم. وقال دليلا على البعث لما أنكروه.

See similar narrations below:

Collected by Ḥākim, Ṭabarānī
hakim:3636Abū ʿAbdullāh Muḥammad b. ʿAbdullāh al-Zāhid > Aḥmad b. Mihrān > ʿUbaydullāh b. Mūsá > Isrāʾīl > Abū Isḥāq > Abū al-Aḥwaṣ > ʿAbd

In His statement, Glory be to Him, "Our Lord, You caused us to die twice and You gave us life twice" [Surah Al-Ghafir: 11], He said, "It is similar to that which is in Surah Al-Baqarah, 'You were lifeless, then We gave you life; then We caused you to die; then We revived you' [Surah Al-Baqarah: 28]."  

الحاكم:٣٦٣٦أَخْبَرَنَا أَبُو عَبْدِ اللَّهِ مُحَمَّدُ بْنُ عَبْدِ اللَّهِ الزَّاهِدُ ثنا أَحْمَدُ بْنُ مِهْرَانَ ثنا عُبَيْدُ اللَّهِ بْنُ مُوسَى أَنْبَأَ إِسْرَائِيلُ أَنْبَأَ أَبُو إِسْحَاقَ عَنْ أَبِي الْأَحْوَصِ عَنْ عَبْدِ اللَّهِ بْنِ مَسْعُودٍ

فِي قَوْلِهِ ﷻ {رَبَّنَا أَمَتَّنَا اثْنَتَيْنِ وَأَحْيَيْتَنَا اثْنَتَيْنِ} [غافر 11] قَالَ هِيَ مِثْلُ الَّتِي فِي الْبَقَرَةِ {كُنْتُمْ أَمْوَاتًا فَأَحْيَاكُمْ ثُمَّ يُمِيتُكُمْ ثُمَّ يُحْيِيكُمْ ثُمَّ إِلَيْهِ تُرْجَعُونَ} [البقرة 28]  

«هَذَا حَدِيثٌ صَحِيحٌ عَلَى شَرْطِ الشَّيْخَيْنِ وَلَمْ يُخَرِّجَاهُ» على شرط البخاري ومسلم
tabarani:9044ʿAbdullāh b. Muḥammad b. Saʿīd b. Abū Maryam > al-Firyābī > Isrāʾīl > Abū Isḥāq > Abū al-Ḍuḥá

[Machine] In his saying "Our Lord, You caused us to die twice and You gave us life twice," it is like that in the cow [surah] "You were lifeless, and He brought you to life; then He will cause you to die, then He will bring you [back] to life, and then to Him you will be returned."  

الطبراني:٩٠٤٤حَدَّثَنَا عَبْدُ اللهِ بْنُ مُحَمَّدِ بْنِ سَعِيدِ بْنِ أَبِي مَرْيَمَ ثنا الْفِرْيَابِيُّ عَنْ إِسْرَائِيلَ عَنْ أَبِي إِسْحَاقَ عَنْ أَبِي الضُّحَى عَنِ ابْنِ مَسْعُودٍ

فِي قَوْلِهِ {§رَبَّنَا أَمَتَّنَا اثْنَتَيْنِ وَأَحْيَيْتَنَا اثْنَتَيْنِ} قَالَ هِي مِثْلُ الَّتِي فِي الْبَقَرَةِ {كُنْتُمْ أَمْوَاتًا فَأَحْيَاكُمْ ثُمَّ يُمِيتُكُمْ ثُمَّ يُحْيِيكُمْ ثُمَّ إِلَيْهِ تُرْجَعُونَ}