Also, sleep. Good sleep, a bit of regular exercise and a bit of a routine are a great deal of help to stablizing your mood and anxieties.
OAuth and OpenID are completely, ridiculously, utterly, pathetically over-complicated. It's one of the worst specs ever released. You do not need to know it to be a professional developer. Most professional developers will have no clue how it works. Trust me, I have over a decade of experience. If you can get a plug and play library, I really would just do that. Especially while learning development.
I mean, if you're enjoying it, go ahead, but OAuth is basically stupid. A cruel joke inflicted on developers and a lesson in how not to make a spec.
Truthfully, the spec itself doesn't seem too difficult to understand; it's mostly my inability to stay focused that causes me the problems I deal with when studying and coding. Perhaps the true culprit of our times are browser tabs; the more I have open, the more overwhelming it becomes to consume them.
As for caffeine and anxiety it's better than the depression that I feel with a lack of caffeine. Caffeine also has a kind of analgesic effect, or rather maybe the lack of caffeine causes me to have more pain in my spine for some reason. Sleep isn't too difficult with chronic melatonin use. Your body never adapts to melatonin as with other substances, so you can maintain the same dose (5mg in my case) with consistent efficacy. I'm out within 30 minutes after taking melatonin.
As far as caffeine goes, I don't know what I'd do without it. Up until recently I was on 2 doses of 3 cups (measurement unit) of espresso per day, but I've realized that I needed to up the dosage, or at least the source. So I went down to 1 dose of 3 cups of espresso + 1 caffeine pill later on, 1 Monster Energy (lowest caffeine content of all my sources I believe), and 1 cup of green tea. This also has the side benefit of pain relief from the muscle tear issues.
As for software development, I'm in the process of learning the ins and outs of OAuth and OpenID Connect prior to implementing a sign up and login. Using Node, so it seems like there is a wealth of tutorials out there for passport, and apparently many of them are insecure (or so I've read), so I want to fully understand the concepts behind the most commonly accepted as secure protocols for Authorization and Authentication. Please correct me if I've said anything gibberish; still learning.