“Sugar also disrupts memory formation.”
Importantly, the brain’s neuroplasticity capabilities allow it to reset to an extent following cutting down on dietary sugar, and physical exercise can augment this process. Foods rich in omaga-3 fats (found in fish oil, nuts and seeds) are also neuroprotective and can boost brain chemicals needed to form new neurons.
There’s also a comment about inflammation and cognitive functioning.
(See also link between inflammation and brain fog.)