There are several ways to play Minecraft together, and the right one depends on how many of you there are, which devices you use, and whether someone is willing to look after a server. Here are the real options, from least to most work.
The quickest option: everyone joins the same public server. There is nothing to set up, the server is always online and there are other players around. Pick a server that fits your group on CraftRank, and if some of you are on phones or consoles, look for servers marked “Java + Bedrock” or browse the Bedrock servers list. The downside is that you share the world with strangers and follow the server's rules.
If you are in the same house, LAN is free and instant.
The world only exists while the host is playing, and it doesn't work over the internet.
On Bedrock, players signed in with a Microsoft account can add each other as friends. When a friend is playing a world that allows multiplayer, it shows up in your Friends tab and you can join, or they can send you an invite. This works across phones, Windows and consoles. Like LAN, the world is only online while the host is in it.
Realms is Mojang's own subscription service. It gives you a small private server that is always online, with no setup and no ports to open. Java Realms and Bedrock Realms are separate, so everyone has to be on the same edition. Realms don't support plugins, and the number of players at once is limited, so they suit small friend groups who want vanilla gameplay.
Your own server gives you full control: plugins, mods, any number of players, and a world that is online whenever the server is. You can run it on your own computer or rent one from a host. Make it private with white-list=true in server.properties and add your friends with /whitelist add <name>. Adding Geyser lets Bedrock friends join a Java server. Start with how to make a Minecraft server and how to make it crossplay.