A nightmare. One option is just don't do it. But if you do, indeed do it you must, grit your teeth; lower your expectations; move everything sharp or breakable out of their way as you would at home (some would go as far as exchanging their wine glasses for plastic but I believe standards here have to be maintained); hide the winch handles which are such fun to toss into the sea — and make very sure to take their mother (or father) with you, hoping she (or he) doesn't get seasick when calming them down below during a rocky passage. An older sibling can be incredibly helpful too. Of course keep the toddlers in a buoyancy aid or lifejacket when they are out of the cockpit (or even in it some would advise) and use a tether and harness when at sea (around which they will undoubtedly become entangled, usually a foot). A folding seat which clamps to the cabin table into which you can lash them is also a must, and setting up a lee cloth behind which they can sleep and play is another useful tip (they will probably soon learn to climb over it). Sticking-in books are a good way to pass the time, and gluing, plus any games you have handy, and their favourite books and cuddly animals. When they are older, give them something useful to do, even steering (all over the place). The little rotters have to be watched all the time.
A useful tip is to heave-to for a while if it gets rough. This takes the pressure off whoever is trying to chase the little wretch around the cabin, get food into their mouths rather than their ears, or get them off to sleep. A tiller-pilot if you have enough battery power, or a wind-vane if not, are incredibly helpful, not just for crossing oceans. They allow both hands of both parents to be free to keep the wretches under control, and out of the sea.
On the whole, keep passages short if you can, with plenty of time ashore for diddling about in rock pools or on beaches, and eating ice cream. Keeping the wretches warm and dry is a given, no mother would fail on this — but fathers might.
The cockpit makes a fine playpen at anchor with plenty of things to play with, like the engine controls and cockpit locker locks (not recommended in those silly boats where the back of the cockpit provides direct entry into the sea). At sea, tossing small bits of paper over the side and seeing them flutter away seems to amuse. Enjoy! And to cheer yourself up, read 'One Summer's Grace' by Libby Purves and realise that your problems are shared.