I struggle with this as well. While I haven't found too many things that really help to make it better, I can tell you what has definitely made it worse.
The sleep issues. Don't get stuck on the horrid daily cocktail of uppers in the day and downers at night.
You get a get a horrid sleep, so you start on the caffeine. Coffee, energy drinks, sugar foods. Caffeine keeps working in your system far, far after your last coffee.
It's tempting to get on sleeping pills, these don't work for long. Either you need something stronger, or you start overdosing. (at least that's what I did/do)
This can make you incredibly unstable, the last thing you need when you need to keep it together. Not to mention how sick this can physically make you as well.
What is helpful, and most companies have it. An employee assistance programme. It is usually confidential and free (at least for a few sessions) It can help to have someone to talk to. The employer pays for it, but does not have anything else to do with it. What is discussed is private (with exception to the standard mandated reporting laws in your country/state, threats of harm to yourself or other's, nothing strange)
Break your day up into as many tiny chunks as you need to. Every task, work on that, only that. Make a list of what you need to do, cover everything other than what you need to be doing right that moment. When one task is done, uncover another, repeat.
Breathe, deep and slow.
If you find that you are distracted easily, try putting something in front of you, to focus on. Stop, breathe. Focus, continue. The more you catch yourself, the faster you get back on track.
At the same time, don't shit on yourself for it. Just be kind to you.
People have bad days, it's ok. Just accept it happens, deep breath and carry on.
Remember that you can only do what you can do. Keep trying to do better, but don't beat yourself up if you don't. Keep trying.
I hope something in this is helpful for you.