I agree, and magnesium is a key one. I certainly find I become sleepier easier if I use magnesium bisglycinate (or any magnesium really, but the bisglycinate is absorbed better and hence has no effect on my bowels!:) Coffee not only provides a stimulant but also prevents magnesium being absorbed well[1], so if you like coffee it's worth taking some.
I also take magnesium bisglycinate, usually at night [1].
I recommend everyone does their research on magnesium deficiency. Supposedly the vast majority of the nation is low in magnesium due to soil quality depletion. Vegetables these days just aren't packing the same punch that they once did.
[1] https://www.livestrong.com/article/447467-can-coffee-deplete...