I read a newspaper story years ago that has stuck with me. A guy was fishing and his line snagged an old piece of pipe with some wires coming out of it. On a whim, he touched the wires to the battery terminals in his boat. Well, it was a pipe bomb (probably made for illegal stunning of fish) and it blew up in his face and injured him quite badly, but he survived. Telling the reporter about it he said, "I remember thinking just before I touched those wires to the battery, 'maybe this isn't such a good idea.'"
If we're honest with ourselves, don't we usually know it when we're about to do something stupid? If only we were better at acting on that knowledge instead of ignoring it and making the mistake anyway. But like Chuff said, maybe as we get older we do eventually learn to pay more attention. I like to think I avoid at least some of the mistakes I probably would have made when I was younger.