You gotta have the conversation with your spouse, partner, kids, and roommates. Even if your kids are very young.
“When I’m sitting here, between these times, I’m working. Unless the house is on fire, or someone is bleeding, please don’t interrupt me.”
Start there. Make sure everyone has been told about your working hours, and your working space, and the expectation of no interruptions.
Of course, there will still be interruptions, and that’s OK. They are inevitable, even if the house isn’t on fire. When this happens, learn the phrase “Yes, but how about this evening or later today?” Or, “Yes, I would love to hear about that, but can we talk about it later?”
Here’s the key to using those phrases: You must follow through. Don’t let them be an empty promise; you lose trust, and the phrases lose their power. Even 4-year-olds (especially 4-year-olds) will hold you to the fire on this.
Unlike in an office where you are physically separate, your home and work lives are now integrated. Realistic boundaries have to reflect that. In the office, you get 8 hours. At home, maybe you get chunks of 1-3 hours. Find what works for both you and the others in your house.
Give yourself and your family members grace and a period of transition. But set those boundaries.