I have a kind of ADHD called predominantly inattentive which basically fucked my shit up, adderall and other drugs don't seem to work or have negative side affects so I often stay off them and I have to follow a kind of schedule to keep myself alert, here are some of the things I do.
1: cardio in the morning to wake myself up and to improve the blood supply to the brain in the long term
2: "time out" sessions, if I feel I can't read more than a few sentences before my brain kind of falls asleep I get up and walk around a bit, this possibly stimulates the rest of the brain releasing neurotransmitters as well as clears your head of any distractions and helps with your mood
3: adequate sleep, when I get enough sleep I feel great in the morning, for a while, the inside of my skull feels fresh like it has been rinsed through, this is how normies feel all the time I think
4: green tea, beets and fruit tea with lots of polyphenols, in theory some of them reduce inflammation and help break down beta amyloid plaques from my brain and some pass the blood brain barrier, it is a compelling theory with some evidence behind it though not strictly proven
5: freshly chopped garlic in meals might help a little by reducing atherosclerosis and raising testosterone in turn helping with cardio
6: I redirect my thoughts elsewhere, I keep making myself think about something else, eventually I remember what I like about science, math or coding and have the motivation to do it.
6a: Good motivation is in fact necessary to even think about something for a long time, if you are motivated it means it is causing the release of neurotransmitters
7: I tried the ketogenic diet and seemed to improve, though I got constipation so I stopped, cutting down on sugar is probably a good thing