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:21:34

And We did not grant to any man before you eternity ˹on earth˺; so if you die - would they be eternal?  

When the disbelievers said that Muhammad (s) would die, the following was revealed: And We did not assign to any human being before you immortality, permanence ˹of life˺ in this world. What, if you ˹are fated to˺ die, will they be immortal?, in it? No! (The last sentence constitutes the ˹syntactical˺ locus of the interrogative of denial).
القرآن:٢١:٣٤

وَمَا جَعَلْنَا لِبَشَرٍ مِنْ قَبْلِكَ الْخُلْدَ ۖ أَفَإِنْ مِتَّ فَهُمُ الْخَالِدُونَ  

ونزل لما قال الكفار إنَّ محمداً سيموت: {وما جعلنا لبشر من قبلك الخلد} البقاء في الدنيا {أفإن مت فهم الخالدون} فيها؟ لا، فالجملة الأخيرة محل الاستفهام الإنكاري.