mental health and gut bacteria seem to be heavily correlated. Anecdotally, if I don't eat sugary "reward" food I tend to feel better. That is also why I adopted intermittent fasting. I tend to fell better mentally if I fast 24h once a week.
Within the past few years (I'm 48), eating a lot of sugary foods would leave me feeling like I was hungover the next day. Headaches were especially common 12-18 hours after lots of sugar.
He specifically references Muslim/Buddhist/Jewish fasts but clarifies that for the purposes of intermittent fasting, water,tea,coffee are OK.