The Reality
I'm not going to lie, having my kids at home 24/7 has had a huge impact on my ability to focus.
The acoustics of my home are such that no amount of calmness can disguise the fact that two young boys are present. Needless to say, when the fleeting moments of calm dissipate into a cloud of noise and chaos spewing up the stairs, it's very challenging to focus on anything at all.
In no particular order, these are the things which have helped me personally.
Git is your friend
My dependence upon Git compare as a tool to regain context has ramped up considerably.
The challenge comes when you don't segregate your commits properly and the resulting risk of unintentional changes escalates.
Comments are priceless
In the past I would have argued that code naming, style and layout should usually be sufficient to make the bulk of what's going on clear. Comments were reserved for particularly detailed pieces of code.
No longer: my comments are often effectively notes to my future self explaining what should be happening (in case the reality doesn't quite meet that desired functionality)
Unit tests as sub-system drivers
I've long been a proponent of unit testing as a way to ensure desired functionality and prevent regression bugs.
Now, I often find myself adding extra test coverage for a feature just to act as a driver to force my brain to fully engage with the functionality at hand.
Teams call with a colleague
When my brain is just failing to re-engage with an issue and I'm spending more time on it than I should, often reaching out to a colleague for a quick "rubber duck" session provides much needed focus as well as some added comraderie.