Sugar is a shortcut to get glucose, however it burns fast so if you want to keep the same buzz you'll have to take more sugar. So a vicious cycle of ups and downs will arise.
In contrast, one can take slower-burning glucose sources. The good news is that this stuff is objectively measured by the Glycemic Index; here's a table for a good variety of foods. https://www.health.harvard.edu/diseases-and-conditions/glyce...
On a good week I'll stick to low GI foods and take no chocolate / red bulls. Will feel productive, and notoriously energetic.
Still one can mix and match - sometimes out of a self-assessment will intentionally seek a short-term boost which (I hope) will not decline sharply because I also ate low-GI foods.