How do you host a Minecraft server? You like Minecraft, but you don't want to play with people you don't know. It's understandable: you can tell your friends to "eff off" a lot more comfortably than a ...
Minecraft Realms is probably the best way to enjoy the world in a multiplayer setting. These Realms are subscription-based, letting you join others' worlds without losing connection and game progress.
You can get a command block in your Minecraft Java or Bedrock world using cheats and a special chat command.