I feel like sugar in general makes me tired and makes it difficult to concentrate. Sometimes (though rarely) I consume sugar in the evening to make me tired.
I can't help but eat candy if it's available, so I just learned not to buy it in the first place.
Sucrose is what bees crave so its pull must be deeply embedded in our reward system. I associate the high sugar consumption with short circuiting the reward system.
I had the same habit. You eat sweets -> blood sugar goes up and you feel energetic. Problem is, it also goes down very fast, at which point you feel sleepy and hungry at the same time.
I know that they're generally bad for the health but I can't seem to stop buying them, especially when I expect to grind leetcode later at night.