The only way not to do stupid things is not to do anything. The trick is to do lots of things, make your mistakes. Just don't repeat them under the same circumstances.