Death, like life, is highly complex, subject to ignorance, superstition, fear, confusion, all of which can lead to errors in judgment. We have a desire within ourselves that mixes with a set of conditions, and we make a choice which can be the fruit of clear perception or, more likely, our desire for what we want to have happen. We see what we want to see; our choice is not based on the reality of a situation, but rather a hope. Depending on the quality of the choices we make, our lives can go fairly well or can seem to be nothing but a journey from one disaster to another.
Death is just like this, only much more dramatic; life seems to be spread out over a phase of time, but the event of death unfolds very swiftly. What is most important at the moment of death is the ability to recognize what is happening. Unfortunately, most often the event of death is unprepared for because our lives are designed to keep the subject of death as far away from us as possible. The basic theme of spiritual life, of all yoga, of the Bardo Thodol, is that life and death are the same; life should be used to prepare for the inevitable encounter with death.