There is a key concept that relates to how stable your energy is: insulin sensitivity.
Insulin is in charge of regulating how your body uses glucose.
When you eat carbohydrates, insulin rises to allow you to store or use the energy that is bottled up in those carbohydrates.
The more "insulin sensitive" you are, the more effectively you can deposit glucose into the bloodstream.
Hence, you can regulate blood sugar levels better, leading to more stable energy.
There is a great article that provides a list of 14 scientifically-backed ways to become more insulin sensitive, which I would recommend a read or quick scan through: https://www.healthline.com/nutrition/improve-insulin-sensitivity#TOC_TITLE_HDR_12
My primary focus to improve insulin sensitivity is intermittent fasting, as I discuss at length in my book.
I also consume 2 tbsp of apple cider vinegar with a splash of lemon or lime juice and water before high carbohydrate meals.