Lots of good comments here, and a few clunkers too.
As we all know, what kills most pilots and their passengers are two kinds of accidents:
1) stall/spin accidents
2) controlled flight into terrain
No. 1 is addressed by what many have said here: keep flying the plane, no matter what, never let anything else distract us from Job #1. This is the most easily preventable accident, yet it is one of the most common forms of "pilot error" after more than a century of powered flight.
No. 2 is usually a matter of lack of situational awareness, or in many cases disorientation resulting from a VFR pilot (or a non-current IFR pilot) flying into IMC. Along with No. 1 - these are the two most frequent and most easily preventable accidents.
Yes, an engine can quit due to mechanical failure, or (far more common) due to running out of gas. Being able to quckly establish best glide speed, doing the thing with fuel pumps or fuel tank selectors and carb heat etc. as appropriate, and then flying to the best available landing site (not necessarily an easy decision) are all extremely important tasks and skills.
However, most of us are far more likely to either stop flying the plane (1) , or to fly the plane right into the ground (2) . No airplane built today is
that crashworthy.
The above stuff has only been said and/or written about a hundred million times or so, yet hundreds of pilots keep doing (1) or (2), over and over and over again, every year.
I guess it's inevitable that a certain percentage of pilots are simply prone to making fatal errors, and until we invent - and convert our fleet over to - a pilot-proof aircraft, it's not going to get better. And of course, a pilot-proof airplane would be no fun to fly, because the machine would have to fly itself.