Reading the comments I have to consider myself very lucky in a way. I work full-remote.
- I never use an alarm, normally waking up around 8:30am
- I often start coding right away when I wake up, in these first 2 hours I am often exceptionally productive
- eat something, coffee, reading, relaxing
- do some more coding till I feel my focus drops
- repeat the last two steps
When I feel tired I try not to code if possible, I consider it being a bad habit.
Relaxing between the focussed coding sessions is of major importance to produce good code IMHO, while relaxing I'm often thinking about the different options of how I can best write the next piece of code.
If I have a bad day, not being really productive, I often do some more coding at night if I can get the right focus.
On a good day I outperform 2 coders that work in the open office of our company, with ease.