Hoist by His Own Petard

Everything About Fiction You Never Wanted to Know.
"Impaled on your own sword, Gilderoy!'"
Albus Dumbledore, "Harry Potter and the Chamber of Secrets", Chapter 18 - Dobby's Reward, Pg. 331.

The villain's own weapon or malicious plan is the cause of his downfall and/or death. This could be something as big as a Mad Scientist who creates monsters and/or a Weapon of Mass Destruction getting killed by his own creation, or as small as prankster accidentally setting off his own trap.

In media intended for young children, it is often a Death by Irony that releases the hero from the unpleasantness of actually killing their enemy; a more specific type of Self-Disposing Villain.

If the Hero is not responsible for the death in any way, it can also be a Karmic Death.

A "petard" is an explosive device (basically a bucket full of gunpowder) intended to demolish gates and fortified walls; being too close to the detonating explosive could well toss the engineer into the air. Thus, this term literally means "Blown into the air by one's own bomb" and was first coined by Shakespeare in Hamlet.

If an Eldritch Abomination, God of Evil or otherwise supernatural evil entity gets Punched Out by the same powers it gave, you have a Faustian Rebellion in action. If it's an Ancient Conspiracy, Government Conspiracy or other organisation whose Applied Phlebotinum is empowering the one who will bring them down, you have a Phlebotinum Rebel. If it's a Mook, long abused, who finally snaps and turns against him at the last moment, it's The Dog Bites Back. It's it's a Video Game boss whose attacks can be redirected back at them, it's Tactical Suicide Boss. Gone Horribly Right is typically a case of this.

Compare Nice Job Fixing It, Villain and Beat Them At Their Own Game (a video game variation on this). See also Didn't Think This Through

As a Death Trope, Spoilers ahead may be unmarked. Beware.

Examples of Hoist by His Own Petard are listed on these subpages: