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:243

Have you not considered those who left their homes in many thousands, fearing death? Allah said to them, "Die"; then He restored them to life. And Allah is full of bounty to the people, but most of the people do not show gratitude.  

Have you not seen (an interrogative to provoke amazement and a longing to hear what will follow), that is, ‘Has your knowledge not attained’, those thousands, four, eight, ten, thirty, forty or seventy thousand, who went forth from their habitations fearful of death? (hadhara’l-mawt: an object denoting reason). These were a people from among the Children of Israel who fled their homeland after it was afflicted with plague. God said to them, ‘Die!’, and they did. Then He gave them life, after eight days or more, as a result of the supplication of their prophet Ezekiel (Hizqīl), and they lived on for a while with the effects of death still upon them, such that when they wore garments these turned into shrouds for the deceased; and this ˹phenomenon˺ remained with their descendants. Truly God is bounteous to people, such as when He gave life back to those just mentioned, but most people, that is, disbelievers, are not thankful. The purpose of mentioning the story of these people is to encourage believers to fight ˹in the way of God˺, which is why the following ˹statement˺ is supplemented to it:
القرآن:٢:٢٤٣

أَلَمْ تَرَ إِلَى الَّذِينَ خَرَجُوا مِنْ دِيَارِهِمْ وَهُمْ أُلُوفٌ حَذَرَ الْمَوْتِ فَقَالَ لَهُمُ اللَّهُ مُوتُوا ثُمَّ أَحْيَاهُمْ ۚ إِنَّ اللَّهَ لَذُو فَضْلٍ عَلَى النَّاسِ وَلَٰكِنَّ أَكْثَرَ النَّاسِ لَا يَشْكُرُونَ  

{ألم تر} استفهام تعجيب وتشويق إلى استماع ما بعده أي ينته علمك {إلى الذين خرجوا من ديارهم وهم ألوف} أربعة أو ثمانية أو عشرة أو ثلاثون أو أربعون أو سبعون ألفا {حذر الموت} مفعول له وهم قوم من بني إسرائيل وقع الطاعون ببلادهم ففروا {فقال لهم الله موتوا} فماتوا {ثم أحياهم} بعد ثمانية أيام أو أكثر بدعاء نبيهم حزقيل بكسر المهملة والقاف وسكون الزاي فعاشوا دهرا عليهم أثر الموت لا يلبسون ثوبا إلا عاد كالكفن واستمرت في أسباطهم {إن الله لذو فضل على الناس} ومنه إحياء هؤلاء {ولكن أكثر الناس} وهم الكفار {لا يشكرون} والقصد من ذكر خبر هؤلاء تشجيع المؤمنين على القتال ولذا عطف عليه.