First- breathe. This is not an emergency situation. There is no need to panic. You are in complete control of this situation.
Go. Join your friends. Admire the cookies. Take one. Pick on you don't like. Psh yeah right! Who doesnt like ALL kinds of cookies! Take one you dont LOVE then.
Thank your co-worker.
Let the cookie sit on your desk. Yes it is staring at you. Yes you WANT to eat it. But you are stronger than the cookie. You are the one in control in this relationship.
After about 30 minutes pass, throw it away. Just plop it into the trash can under your desk.
Take a sip of water.
Rejoice in your victory, and STOP THINKING ABOUT THE COOKIE.
Yes it is right there. Yes you COULD technically grab it and eat it. But you arent going to. Because you are in control. You don't actually WANT the cookie.
Discretely give yourself a high five under your desk. Discretion is best because people will look at you like you are crazy if they see it. I know this from experience.
*Note: You could always eat the cookie if you feel like you are in control enough to not casually walk by and stuff 4 more in your pocket on the way to the bathroom where you proceed to shove them in your mouth while silently weeping.
You can make it through the next couple weeks. I promise.