Minecraft is one of the few truly excellent kid games — but the multiplayer side varies from "walled garden with four cousins" to "open server with strangers." The settings determine which you get.
At account.microsoft.com/family, add your child's Microsoft account as a family member. This is the same family used for Xbox.
Family settings → child → Xbox privacy & online safety → Minecraft multiplayer. Three levels: Off, Friends only, Everyone. For under-12, Friends only is our default.
Same menu → You can add friends → Allow / Block. Block means only you can add new friends for them; great for younger kids.
A Realm is a private server you pay for — typically the safest multiplayer option because you control who's on it. Public servers (Hypixel, etc.) have their own moderation that varies wildly.
Most large public servers publish rules. Read them with your kid. If a server doesn't obviously moderate chat, skip it.
In-game: Settings → Chat → Off. Your child can still play; they just can't type to strangers.
Spend 20 minutes watching them play on a new server before leaving them to it. You'll learn a lot about the community.
If they're on Java, look through .minecraft/mods. Most mods are fine; a few (rarely) include chat or network features you don't want.