The best advice I ever heard about losing weight was that it's like going down a set of stairs. One misstep is not a bad thing. So you trip on a step and overeat, or don't exercise that day. Don't give up and continue to overeat, or forget about exercise that week and start again on "Monday". Pick yourself up, dust yourself off and move on with your journey at *that* moment.
The stairs analogy comes into play, by reminding ourselves that when we "trip on the stairs" we don't throw our hands up in the air and give up and just throw ourselves down the rest of the stairs, now do we? Same with weight loss. Decide what you have to do, then just get to it. You will trip every now and again, but if you persist you'll be the winner in the long term.
I lost (and have kept off for a year now) 40 lbs with that attitude. I hope it helps you too. I'm a bit of a perfectionist and found it easy to beat myself up for my "mistakes" and then get utterly discouraged. This helped me to keep that in perspective.
Think long haul. Think one pound at a time.