There's also a multiplayer where they can connect to servers and play with other people. That's where you might want to use some discretion, as the experience will vary from server to server.
Online/shared server modes: when they understand the evils of the internet well enough to be safe.
Setup and admin a server yourself. Watch how they play. Dont let it get too big. A dozen or two per server. Dont let them play with thousands of total strangers. That always ends in tears.
You can also just expose any client's game instance to your local LAN - that's all I do when playing with my grandkids.
There are ways of doing multiplayer on your local LAN with a single account as well by simply editing your name in a single config file per machine. Google is your friend there. :)
to host an Internet-accessible server pretty easily (on a DigitalOcean droplet).
There are basically two version of Minecraft at this point. The "classic" Java version, and the MCPE version, which is what you get on Apple devices, Android and the "native" Windows 10 version.
The latter has "realms", where you can just pay to have Microsoft host it for you, and is tied into Xbox Live.
Java Edition is the one that lets you run your own server, is more moddable, and works on Windows, Mac, and Linux.
Bedrock Edition is the one that works on Windows, consoles, and mobile. People can invite people into their own world as long as they're online. Your only private server option is Realms, which is a subscription service. (Edit: Apparently there is finally publicly-available server software for Bedrock Edition. I doubt it's very moddable though, so don't expect to be able to run a public server with all the modded tools you'd expect if you were familiar with running Java Edition servers. Also, I don't think the console versions of Minecraft can join arbitrary servers.)
The Java Edition and Bedrock edition are not cross-compatible with each other. They are fully compatible within each-other though. Bedrock Edition supports cross-play between different consoles and PC, etc.
For playing with random internet people? 30 years old