Sure Aal-i-Imraan

3:145

وَمَا كَانَ لِنَفْسٍ أَن تَمُوتَ إِلَّا بِإِذْنِ ٱللَّهِ كِتَٰبًۭا مُّؤَجَّلًۭا ۗ وَمَن يُرِدْ ثَوَابَ ٱلدُّنْيَا نُؤْتِهِۦ مِنْهَا وَمَن يُرِدْ ثَوَابَ ٱلْءَاخِرَةِ نُؤْتِهِۦ مِنْهَا ۚ وَسَنَجْزِى ٱلشَّٰكِرِينَ

Keiner Seele ist es möglich zu sterben, außer mit Allahs Erlaubnis (und) nach einer befristeten Vorbestimmung. Wer die Belohnung des Diesseits will, dem geben Wir (etwas) von ihm; und wer die Belohnung des Jenseits will, dem geben Wir (etwas) von ihm. Und Wir werden (es) den Dankbaren vergelten.

Tafsir 3:145

No person can die except by the divine decree of Allah, when the time Allah has written for them has come to an end and their set time of death has arrived: their life will not be made longer or shorter. Whoever desires worldly gain through what they do, Allah will give them of it, according to what He has decreed for them, and they will have no share in the Afterlife. Yet whoever desires the reward of Allah in the Afterlife through what they do, Allah will give them its reward, and He will give a great reward to those who are thankful to their Lord.