An act of folly.
Regretted the follies of his youth.
This is a war of folly.
The purchase of Alaska from Russia was termed Seward's folly.
An example of folly is someone intentionally stabbing their foot with a pitch fork.
An example of folly is building a hospital on an earthquake fault line.