I have a ritual and some rules:
I mentally prepare 30-60 minutes beforehand.
A cup of coffee is nice and warm while I read HN, check socials, etc. It perks me up, puts me on a track.
Work is distant here. It's going to happen, but it's not important now.
I finish my coffee at the pace I finish reading, clean up, and then setup my work space.
This is vital to me. The more work I put into ergonomics early on, the less I have to readjust later.
I have a set of rules to follow for efficiency.
1. I need minimal distractions. Headphones and instrumental music work great for me personally. Visually I can focus on a rectangular screen and that becomes a visual boundary for me. Among other people I set rigid boundaries.
2. I need minimal movement to accomplish a task. My peripherals are in arm's reach. If I need to break from work it takes maybe two motions maximum to set aside anything I'm using. Coming back to work, just reverse the motions.
I then focus on reassessing the problem(s) I left the previous day.
I find the smallest problem I can fix and gradually descend into larger structural issues I would like to solve or build. With my design these are usually emergent as I take the small problems, but the benefits are double-fold because I like to ease in and gain confidence as I work. It's like starting a marathon at a steady pace versus a sprint I guess.
Rinse and repeat. Take breaks. If you are having issues with some deep work, pull yourself up and give yourself a mental snack like (for gamedev) a simple shader that you can just play around with.
Nothing wrong with checking socials or your phone, but I physically go somewhere else. To me, it's an invitation into my workspace and because this space is sacred for me, I can determine what signals come and go.
My 2c.