Not my wheelhouse, but doesn't that involve packing the aircraft with explosives, and wouldn't that involve risk of blowing up if someone else shoots you? Or is there some better way to self-destruct?

One could calculate the amount of energy in a given amount of explosive and smashing into the ground at high velocity. I'm too lazy to do so, but I can tell you they're on the same scale.

A heavy object moving fast has a shocking amount of energy. When such an object impacts the ground, all that energy has to go somewhere.

Impacting the ground usually does it.

Assuming there is an autopilot present, nose diving at max afterburner straight down is probably going to yield a similar result

You could self-destruct just the software / computers by encrypting everything with a few keys that are easy to destroy.

This is a standard technique for quick and secure data wipes, particularly on e.g. modern SSD drives where a traditional wipe might be incomplete due to wear leveling algorithms.

There are probably a number of clever and failsafe ways to divert jet fuel somewhere that would destroy the plane on command.

Jets are usually full of jet fuel that can blow up if someone else shoots you, or they run into the ground.