it is allah who gives death* to living beings at the time of their demise and to those who do not die during their sleep so he restrains the soul on which the decree of death has been passed and leaves the other till the appointed term indeed in this are signs for people who reflect. 
الله يتوفى الأنفس حين موتها والتي لم تمت في منامها فيمسك التي قضى عليها الموت ويرسل الأخرى إلى أجل مسمى إن في ذلك لآيات لقوم يتفكرون