Urges when I am anxious

Hello coaches

I have noticed that whenever I feel anxious or in situations when my brain is spinning with thoughts there is an increased urge to have sugar. I crave for peanut butter bars/cookies or some kind of candy. I’m in place where I have to handle two emotions – anxiety and the urge to eat. Also I have noticed once the anxious thoughts are settled ..the urge for the sugar increases more like I have to reward myself for handling this emotion..how I do handle these emotions together?