In working through nutrition and lifestyle changes a common theme is typically how to stay on track in the face of temptation of non ideal food items. One thing that comes to mind was a motivational talk that former Notre Dame National Champion Coach, Lou Holtz, used to give in the early 90's. Holtz may have picked this up from someone else but he used the acronym W.I.N. What's Important Now.
I like this acronym. It is simple. It keeps goals in mind but it also recognizes the here and now which often times gets lost when looking at a goal that seems light years away. It can keep things minute by minute if that is what you need to make your next decision.
Look at the choice you are going to make and decide what is important now in order to match up with your goals. Definitely easier said then done but it is simply just that. Match your actions with you goals and make sure that they match. So if those cookies are what's important now than eat up but I'm guessing it's not.