If you instantly die when you're sleeping, do you wake up, then die ?

Just wondering, If you instantly die, heart gives out brain, everything at one instant. What do you think would happen? What if you're in a dream? Is the dream really connected to the body or the soul ?