Folly is a noun that means "foolish or crazy behavior." It would be folly to spend all night playing video games when you have a difficult exam the next day.
Folly comes from the Old French word folie meaning "madness, stupidity." It can describe the silly or nonsensical things you do, like the folly of trying to rush across town in the middle of a snowstorm. Or it can describe the trait that makes people act that way: the folly of an inexperienced driver who doesn't know you can't speed on snow-covered roads. Can you see the word fool in folly? Not a coincidence.