I wanted to play Minecraft online with my friend (we both play Java edition), but we both don't know how. So how does it work?
Do you want to play on your server or on an external one (hypixel etc)?
I would recommend you to watch a video on YouTube or anywhere else
Either you both get a Realms subscription, so you can play on the official Minecraft servers https://www.minecraft.net/...-for-java/
Or you book yourself a server via e.g. Nitrado.https://server.nitrado.net/deu/gameserver-mieten/minecraft-vanilla
We wanted to play on our own server
You create an online game (either on your PC, or by means of a game server), then you give the friend your IP, provided that you have it running on your PC with the port number: So quasi XXX.XXX.XXX.XXX:25565. If you rent a server, you will see the IP in the controls.
Have you already rented or bought a server?
Then you would only have to give your friend the IP address that he can enter, for example, in "Connect directly" in the multiplayer tab.
If you don't have one yet, rent one (or more?) From Nitrado, MC-Host24 or Minehub.
I don't understand this
Sorry, I just see that it doesn't seem to work anymore. It looks like you have to rent a server, which is also available for free (just google), or for a few euro here https://server.nitrado.net/deu/gameserver-mieten/minecraft-vanilla. The handling differs from provider to provider, you just have to see. At Nitrado everything is nice and clear.
You can create your own free server with aternos