Home-based working with kids at home is a challenge. In some cases, truly, the right answer is childcare.
Even with that, there will be times when the young ones are at home. From age four and up, I found I could negotiate some time to work.
With the youngest ones, get a timer and set it where they can see. You might start with as little as five minutes just so they get the idea. Then work up to 15 minutes when they are safe to be unsupervised for that long.
I set the timer and make them a promise for something special we’ll do if they let Mommy work until the timer goes off. Make it good! Read a favorite book, play or go for a walk.
If they interrupt before the time is up, ask them if the timer has gone off yet. As soon as it does, stop what you are doing and deliver on your promise.
When they know you’ll keep your promise they’ll be better able to let you get some work done.