Had these sorts of issues all my life, I'm pretty sure most people do to a greater or lesser extent.
Life asks a fuck of a lot of us. More as we age, but more as the world changes.
On a good day, I naturally don't think about it. On a bad day, it's all I can think about. On an average day I've come to accept peaks and troughs.
I can't be running on all cylinders all the time, most people can't.
Mood for me is key. Others have mentioned sleep, exercise and diet, the holy trinity.
Alcohol is guaranteed to mess me up and I generally avoid it these days. Time outside without the phone is also magnificent, I might do that now.
Don't beat yourself up.