Certain B vitamins - B6, B12 and folic acid - are known to reduce levels of a compound called homocysteine in the blood. Elevated levels of homocysteine are associated with increased risk of stroke, cognitive impairment and Alzheimer's disease. A study of a group of elderly patients with mild cognitive impairment found that after two years of intervention with high doses of B6, B12 and folic acid there was significantly less brain shrinkage compared to a subset given placebo treatment. Opt for B-rich foods like eggs, chicken, fish and leafy greens.
Caffeine (Examine.com; FDA adverse events) is of course the most famous stimulant around. But consuming 200mg or more a day, I have discovered the downside: it is addictive and has a nasty withdrawal - headaches, decreased motivation, apathy, and general unhappiness. (It’s a little amusing to read academic descriptions of caffeine addiction9; if caffeine were a new drug, I wonder what Schedule it would be in and if people might be even more leery of it than modafinil.) Further, in some ways, aside from the ubiquitous placebo effect, caffeine combines a mix of weak performance benefits (Lorist & Snel 2008, Nehlig 2010) with some possible decrements, anecdotally and scientifically:

Mercury, as well as other heavy metals such as lead, can accumulate in brain tissue, as well as in the spinal cord, as they are fat-soluble - meaning that they can hide itself in fat tissue, which is abundant in both the brain and the spine. Once there, they can displace important nutrients for brain health such as zinc and iron, which are needed for neurotransmitter production, as well as induce an inflammatory process called oxidative stress among other things.
I decided to try out day-time usage on 2 consecutive days, taking the 100mg at noon or 1 PM. On both days, I thought I did feel more energetic but nothing extraordinary (maybe not even as strong as the nicotine), and I had trouble falling asleep on Halloween, thinking about the meta-ethics essay I had been writing diligently on both days. Not a good use compared to staying up a night.
Compared with those reporting no use, subjects drinking >4 cups/day of decaffeinated coffee were at increased risk of RA [rheumatoid arthritis] (RR 2.58, 95% CI 1.63-4.06). In contrast, women consuming >3 cups/day of tea displayed a decreased risk of RA (RR 0.39, 95% CI 0.16-0.97) compared with women who never drank tea. Caffeinated coffee and daily caffeine intake were not associated with the development of RA.
Nootropics (/noʊ.əˈtrɒpɪks/ noh-ə-TROP-iks) (colloquial: smart drugs and cognitive enhancers) are drugs, supplements, and other substances that may improve cognitive function, particularly executive functions, memory, creativity, or motivation, in healthy individuals.[1] While many substances are purported to improve cognition, research is at a preliminary stage as of 2018, and the effects of the majority of these agents are not fully determined.