I'm my own worst enemy sometimes. After a long day I might end up stuck on something I'm designing, and stubbornly soldier on, trying to find the solution.
There's nothing wrong with working late - some of us are night owls, and prefer the dark solitude to be productive. The problem is, often on a workday my brain has been going for over eight hours, and the quality of work, and the time needed to get to a solution is exponentially longer if I'm tired or overworked.
Note to self: you will solve this in 1/3 the time in the morning with a fresh brain. I promise.
I've started getting into a good habit of trying to finish work at a reasonable time, and 'clearing the decks' both physically and mentally.
'Clear the decks': A naval expression urging seaman to stow gear and prepare for battle or other action.
I write a lot of notes on scrap paper as I work, and things can be a mess. A 5 minute cleanup, putting things into the right places and trying to keep a clear surface helps my mental focus the next day.
Likewise, I start a new page in my notebook, and write out the top 3 things I want to get done, plus details of the thing I'm working/stuck for the next day.
This does two things:
it parks things mentally, so that you don't dwell on things.
it clarifies the problem through writing it down.
The next day fresh perspective + morning energy + a break means your brain solves the problem in less than half the time, and you come up with the solution while doing other things.
It turns out there's a reason you were supposed to clear off your school desk, so it was tidy and ready for action the next morning - less distractions. Combining that with a clear action list from the night before, and you start the day on cheat-mode.