At my old office we had nap rooms. They weren't called that, but that's what they were. They had large double-bed-sized couches with blankets and pillows, dim lighting that could be turned off completely, and just a very cozy vibe. Sometimes I'd manage to sleep there over lunch, but I later realized it was when I was just generally sleep deprived. When I started getting more sleep at night, the naps stopped working and I'd spend lunchtime reading in the nap rooms instead.
But what I do find helps similarly is taking walks if I'm stuck on some problem. I keep forgetting to do it, but it's happened by accident enough for me to know that it works. Sometimes I'd be stuck on some problem for a couple of hours and finally force myself to get off of the PC to walk to the grocery store for food. And within minutes the solution or at least a clear new approach to try comes to me while I'm on my way to or from the store. Often it's something I later consider to be obvious, but that I just somehow overlooked in my hours of fixating on the screen.
I tried the coffee then sleep thing, shorter naps, etc. Meditation like "Non Sleep Deep Rest Yoga Nidra" works better, but most days I try to wake up instead... so: coffee, or loud music, or taking a walk.
When ive got a problem, I take little micro-breaks, a quick walk around the garden, water the plants, checking on my cat, tidy up things in the wrong place. Maybe I'm just procrastinating instead.
https://news.ycombinator.com/item?id=25427090
It also does a memory cache reset during sleep, from what I gather.
Basically you walk at a slow pace in a most non-crowded place while passively focusing on some specific sensation, but not thinking about it or getting distracted by other thoughts and sensations. In my case it's usually the sensation of air during breathing through the nose. If you do get distracted you just gently return your focus back to observing without internal fuss or overanalyzing. Also music and smartphone are a big no there.
usually I'm fine