Ali 'Imran 3:145
وَمَا كَانَ لِنَفْسٍ أَن تَمُوتَ إِلَّا بِإِذْنِ ٱللَّهِ كِتَـٰبًا مُّؤَجَّلًا ۗ وَمَن يُرِدْ ثَوَابَ ٱلدُّنْيَا نُؤْتِهِۦ مِنْهَا وَمَن يُرِدْ ثَوَابَ ٱلْـَٔاخِرَةِ نُؤْتِهِۦ مِنْهَا ۚ وَسَنَجْزِى ٱلشَّـٰكِرِينَ
Wama kana linafsin an tamootailla bi-ithni Allahi kitabanmu-ajjalan waman yurid thawaba addunyanu/tihi minha waman yurid thawaba al-akhiratinu/tihi minha wasanajzee ashshakireen
And it is not [possible] for one to die except by permission of Allāh at a decree determined. And whoever desires the reward of this world - We will give him thereof; and whoever desires the reward of the Hereafter - We will give him thereof. And We will reward the grateful.
It is not the choice of a person to die without the will of Allah, death being a time-bound destiny. Whoever seeks a reward in this world, We shall give him out of it, and whoever seeks a reward in the Hereafter, We shall give him out of it. We shall soon reward the grateful.