When I get down to really focused work, I mutter like a madman. I stare into the middle distance and mouth arcane syllables. If I’m really into it I start making inscrutable hand gestures. To a bystander it looks a little like I’m performing a ritual, or sending a nefarious secret message to a nearby invisible warlock.
My perfect work space is very dark - just a reading lamp pointed at a notebook and the light from my monitors. Dark helps me concentrate. I think that’s true of most programmers, which is why we like to work at night.
I need something to drink, but not a lot of it because I need a lot of excuses to stand up and walk around, and going to refill my drink is perfect as long as no well-meaning coworkers or invisible warlocks interrupt my train of thought on the way there or back.
It’s a weird process, but it seems to work for me. Whatever your process is, you’ve gotta trust it. And whatever other peoples’ processes are, you’ve gotta respect them. Nothing gets done if you interrupt the process.