Keep your thoughts positive!
This isn't as easy as it sounds, but it is doable. Try to stop the negative self-talk immediately and replace it with a positive statement.
For example: If you find yourself saying, "I can't do this - I am just such a dummy!" - turn it around by saying, "I know I slipped up, but I am sure I can get myself back on track - I am a smart person!"
Do this regularly - every single time you hear that nasty internal voice - and before you know it, you will find yourself automatically treating yourself better!