From my experience lack of sleep or low quality sleep will cause all kinds of problems. When I am sleep deprived I can't think straight, get irritable, anxious and depressed. And I think I observe this in other people too.
I can't get anything done, so I lie away worrying about the things I didn't do. Repeat.
The only fix for me seems to be adrenaline. Working on something exciting, playing games, exercise - I don't feel tired. But brain work is hopeless and I struggle to get through the day.
I can correlate with this. My primary tool at work is my own brain and it's stressful to watch myself make mistakes due to my own choices, such as going to bed late, overeating, and overdrinking.
It's solvable, though, and I'm taking steps to help myself.