"Allah takes souls at the time of their death and [the souls] of those that do not die during their sleep. He retains those souls for which He has ordained death, whereas He releases the rest for an appointed term."
Ibn Al-Qayyim identifies over 90 supporting statements from the Qur'an, the Sunnah and sayings of the companions, which altogether give a complete picture of the nature of the human soul and the conditions which surround it.
"If you could see when the worngdoers taste the pangs of death and the angels stretch their hands out, [saying], 'Deliver up your souls. This day you will be awarded a degrading punishment.' "
Here it is stated that death is painful for the disbelievers. Although they are ordered to surrender their souls to the angels, they are unwilling; therefore, the soul must be forced out as it does not wish to meet its punishment. [Qurtubi]
According to hadith, the Angel of Death ... says, "O you foul soul, come out to the anger and wrath of your Lord." The soul inside the disbeliever's body is overcome by terrible fear [and does not want to deliver itself up], whereupon the Angel of Death violently pulls it out like multi-pronged skewers being yanked out of wet wool - tearing with them the ateries and nerves.
Umm Salamah (radhiallahu 'anha) reported: Allah's Messenger (sallallahu 'alayhi wa sallam) entered upon Abu Salamah [i.e., his corpse], whose eyes were wide open. The Prophet closed the lids and then said, "When the ruh is taken out, the eyesight follows it [i.e., watches it ascend]." [Muslim & Ahmad]
The Angel of Death comes to the [dying] believer, sits at his head and says, "O you good soul, come out and receive your Lord's forgiveness and pleasure." Then the soul flows out effortlessly just as water flows from the mouth of a waterskin.
Abu Hurayrah (radhiallahu 'anhu) narrated that the Messenger of Allah (sallallahu 'alayhi wa sallam) said: "When the soul of a believer comes out [of its body], two angels receive it and rise with it towards the heavens, whereupon the inhabitants of the heavens say, 'A good soul has come from the earth. Allah has blessed you and the body which you used to occupy.' " [Muslim]
The Nafs and the Ruh
The correct view, as maintained by the vast majority of Muslim theologians and endorsed by the scholars of Ahlus-Sunnah, is that the terms nafs and ruh are interchangeable. However, the term nafs is usually applied when the soul is inside the body, and the word ruh is used when the soul is aprt from the body. However, each one has clearly distinct and restricted applications in certain contexts. E.g., nafs may represent self as in 24:61, or revelation as in 42:52, or Jibril as in 26:192-193, or in an even more restricted sense e.g., spirit of faith as in 58:22.
Ahadith which Prove that Both are the Same Thing
Umm Salamah (radhiallahu 'anha) reported that the Messenger of Allah (sallallahu 'alayhi wa sallam) said, "When the ruh is taken out, the eyesight follows it."
Abu Hurayrah (radhiallahu 'anhu) reported that the Messenger of Allah (sallallahu 'alayhi wa sallam) said, "Do you not see that when a person dies his gaze is fixed intently? That occurs when his eyesight follows his nafs [as it comes out]." [Both in Muslim & Qurtubi's at-Tadhkirah] Also see Siddiq Hasan Khan's Fath ul-Bayyan.
The Experience of Death
"Every soul will taste death."
Hardships and Agonies
"And the agony of death comes, in truth; that is what you wished to avoid."
In this verse the phrase "sakratul mawt" is used to indicate the swoon of death. This verse implies that every dying person must experience some pain and torment. [See al-Alusi's Ruh al-Ma'ani and Qurtubi's tafsir]
'Aishah (radhiallahu 'anha) related: [On the occasion of his approaching death], Allah's Messenger (sallallahu 'alayhi wa sallam) had a small vessel of water placed before him. He began to dip his hands in the water,a nd wiping his face with them. He said, "There is none worthy of worship except Allah. Indeed death brings with it agonies!" Then he raised his hand up and kept repeating, "In the Most Exalted company" until his soul was taken and his hand fell limp. [Bukhari]
'Aishah (radhiallahu 'anha) reported: Truly, I saw the messenger of Allah when death approached him. He had a container with some water in it into which he dipped his hand and then wiped his face. Then he said, "O Allah help me to overcome the agonies of death."
Appearance of Satan
Hadith: "Verily Satan comes to you at all circumstances and affairs of your life, even at the time of eating." [Muslim]
Al-Qurtubi mentions that a great number of pious and dependable scholars are known to have witnessed the presence of Satan at death. He relates that he heard one of his own respected teachers, Imam Abul-'Abbas Ahmad ibn 'Umar al-Qurtubi, say, "I visited the brother of our teacher, Shaykh Abu Jafar Muhammad al-Qurtubi at Cordoba and found him near death. It was said to him, 'Repeat La ilaha illallah,', to which he replied, 'No! No!' When he came to, we mentioned what had occurred. He said, 'Two devils came to me, one on my left and the other on my right. One of them said, 'Die as a Jew, for verily it is the best of religions,' while the other said, 'Die as a Christian, for truly it is the best of religions.' So I answered them saying, 'No! No! How dare you say such a thing to me!' "
Repentance Before Death
Hadith: "When any of you completes the last tashahhud of his prayer, let him seek refuge in Allah from four things, saying, 'O Allah, verily I seek refuge in you from the punishment of the Hellfire and the torment of the grave; from the fitnah of life and of death; and from the evil fitnah of the false messiah.' " [Muslim, Nasa'i & others]
Allah accepts the repentance of the servant so long as his spirit has not arrived at his throat. [Tirmidhi, al-Hakim & ibn Hibban]
"Their faith was of no use to them once they saw Our doom."
"Forgiveness is not for those who continue to do evil deeds up until when death comes to one of them [and] he says, 'Truly, I repent now!' "
Extracted with slight modifications from Mysteries of the Soul Expounded, Abul-Qasim Publishing House