Surah Az-Zumar 39:42
ٱللَّهُ يَتَوَفَّى ٱلْأَنفُسَ حِينَ مَوْتِهَا وَٱلَّتِى لَمْ تَمُتْ فِى مَنَامِهَا ۖ فَيُمْسِكُ ٱلَّتِى قَضَىٰ عَلَيْهَا ٱلْمَوْتَ وَيُرْسِلُ ٱلْأُخْرَىٰٓ إِلَىٰٓ أَجَلٍ مُّسَمًّى ۚ إِنَّ فِى ذَٰلِكَ لَـَٔايَـٰتٍ لِّقَوْمٍ يَتَفَكَّرُونَ
Allāh takes the souls at the time of their death, and those that do not die [He takes] during their sleep. Then He keeps those for which He has decreed death and releases the others for a specified term. Indeed in that are signs for a people who give thought.
Translation: Saheeh International
Tafsir
God takes the souls at the time of their death and He takes those that have not died in their sleep in other words He takes them during sleep. Then He retains those for whom He has ordained death and releases the others until an appointed term that is until the time of their death. …
Excerpt from Tafsir al-Jalalayn, commentary on 39:42, via Quran.com. The reader has the full commentary and 9 more tafsirs.