In Islam, Yawm al-Qiyamah is believe to be God’s final
assessment of humanity. The sequence of events (according to the most
commonly-held belief) is the annihilation of all creatures, resurrection of the
body, and the judgement of all sentient creatures.
When the soul leaves the body, it can take a long time or it
can happen very quickly. No matter how, it is painful. It is painful for the
one who is dying, and it is painful for those who are left behind. The
separation of the soul from the body, that is the ending of life.