Biography
The villain's own weapon or malicious plan is the cause of their 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 their own creation, or as small as a prankster accidentally setting off their 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. Would also overlap with Accidental Suicide.
A "petard"note was an explosive device (basically a bucket full of gunpowder, and a medieval ancestor of the land mine) intended to demolish gates and fortified walls; being too close to the detonating explosive could well toss the engineers who planted it into the air. Thus, this term literally means "Blown into the air by one's own bomb" and was first coined by William Shakespeare in Hamlet, though the original quote was "hoist with his own petard".
If an evil 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 done by making him hit himself, it's Stop Hitting Yourself. If it's attacking them with their own weapon, it's Use Their Own Weapon Against Them. If it's a Mook, long abused, who finally snaps and turns against him at the last moment, it's The Dog Bites Back. If it's a Video Game boss whose attacks can be redirected back at them (tennis-style or otherwise), it's Tactical Suicide Boss. Gone Horribly Right is a sub-trope where a Super Prototype works too well, destroying the person or persons who created it and/or threatening the world/galaxy/universe. If it's a vehicle that you just stole, it's Vehicular Turnabout.
Can be the result of Didn't Think This Through, but not necessarily. Compare Nice Job Fixing It, Villain, A Taste of Their Own Medicine, and Beat Them at Their Own Game. The Streisand Effect is a subtrope of this, when the petard is censorship.
For examples involving literal (explosive) petards, look up Explosive Stupidity, Grenade Hot Potato, and Pineapple Surprise.
As this is often a Death Trope, all Spoilers will be unmarked ahead. Beware.