Positive self-talk really does make a difference in your mood and attitude. It can change your whole outlook on a bad situation, and make a good one even better. Instead of "That was stupid of me" or "I hate myself", think of the good thing you can learn from the situation and say that to yourself.
Yesterday, I spilled cherry tomatoes all over the kitchen. As I was grumbling, I listened to what I was saying, "I'm grateful they just rolled and didn't smash. I'm glad they weren't full-size tomatoes. At least they're all in easy reach. I can just pick them up without having to clean a big mess."