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:63:10

And spend ˹in the way of Allah˺ from what We have provided you before death approaches one of you and he says, "My Lord, if only You would delay me for a brief term so I would give charity and be among the righteous."  

And expend, in alms, of that with which We have provided you before death comes to any of you, whereat he will say, ‘My Lord, if only (law-lā means hal-lā, ‘why ˹do You˺ not’; or the lā is extra and the law is optative) You would reprieve me for a short time so that I might give charity (assaddaq: the original tā’ ˹of atasaddaqa˺ has been assimilated with the sād), that I might offer alms, and become one of the righteous!’, by making the Pilgrimage. Ibn ‘Abbās, may God be pleased with both ˹him and his father˺, said, ‘Every person who has fallen short of ˹his duty regarding˺ alms and the Pilgrimage will ask to be returned ˹to this world˺ at the moment of death’.
القرآن:٦٣:١٠

وَأَنْفِقُوا مِنْ مَا رَزَقْنَاكُمْ مِنْ قَبْلِ أَنْ يَأْتِيَ أَحَدَكُمُ الْمَوْتُ فَيَقُولَ رَبِّ لَوْلَا أَخَّرْتَنِي إِلَىٰ أَجَلٍ قَرِيبٍ فَأَصَّدَّقَ وَأَكُنْ مِنَ الصَّالِحِينَ  

{وأنفقوا} في الزكاة {مما رزقناكم من قبل أن يأتي أحدكم الموت فيقول رب لولا} بمعنى هلا، أو لا زائدة ولو للتمني {أخرتني إلى أجل قريب فأصَّدَّق} بإدغام التاء في الأصل في الصاد أتصدق بالزكاة {وأكن من الصالحين} بأن أحج، قال ابن عباس ؓ: ما قصر أحد في الزكاة والحج إلا سأل الرجعة عند الموت.