As a Muslim I believe that we live as long as God wills and will then die when He alone wills. We will be then resurrected,tried for our deeds, then either will have an eternity of happiness or misery due to what our own hands have earned.  According to our Islamic  beliefs ,whilst God has given us "choice" in many matters of our life in this world as far as death(when,where,how etc we will die) and our afterlife we have no choice. 

That said many people have experienced near death situations. Where you truly believed you were going to die only to survive. I have had such situations and in that case I still believe I only lived,not because I chose to, but cos it was not my God granted time to die yet,Alhamdullilah.And that it was simply another lesson from our Lord as to know that death is unavoidable so be prepared.

May we all have blessed ends and an eternity of bliss..Aameen!