I've heard people with families kids can struggle with this. The people I know who've been successful at it seem to always have some kind of office work space where they can close the door and get a bit of isolation, or, they invest in an offsite office of some kind.
This is the key - separate office. I've been working from home for 7+ years. My wife and I homeschool our 7 kids. They all know when dad is in the office, he's working and the only interruption I allow is a request for a hug. When I take breaks, we have fun, get rowdy, and help with school work and chores. But when dad's in the office, he's working (even if I'm just burning cycles on HN!)
My kids respect my workspace just fine. It's my spouse that can't or won't leave me alone when I'm working from home. If I ever wanted to go 100% remote, I would almost have to work in a completely separate building, which makes the whole thing a non-starter.