Multiplayer with servers

Hello everyone! I have a question:
Im making a survival open world game and I want to be mutliplayer
I want peoples to be able to create a server on their own computer and other players to be able to join in this server
And my qustion is how to make this
If you dont understand me just look at Rust or Minecraft where you need to download some kind of file and host the server on the computer
Thank you so much!