This is most definatly a problem i suffered from when i was more newb than i am. I actually did it yesterday for the first time in a long time with guess what?! rockets!

My solution was to post a post-it note next to the computer with the things i did and to consult the note every new card every hand i was involved in. Also, as AOKrognly suggested i wrote down my mistakes a hundred times and soon i started to think before i made a donk play.
What is it then?
Patience and discipline!
But you need to helpyourself. SO i reccomend you make a note of the supid things you do, then when u do one quit poker for the day and write out ALL the mistakes 100 times, not just the one you did!
I found i stopped doing it instantly