Cookies ahh

Hey all I’m about 4 weeks pregnant!! This morning I woke up with an intense craving for cookies and I ended up having three!! I am very conscious of what I put in my body during pregnancy and I make a strong effort to eat things that benefit my baby. However, I now feel terrible about his impulsive food choice. The sugar I ate was definitely an over load as my body is bitterly. I just want to make sure baby is safe and has the best chances. Anyone experiencing this? How do you avoid cravings?