Every Minecraft server needs an address for players to type into their client, and where you find that address depends on how the server is being run. Here is how to track it down for the three most common setups.
If you are using a hosted server
This is the easiest case. Almost every hosting provider displays the server's IP address (and port, if it is non-standard) directly on the control panel dashboard, usually right next to the start/stop controls. Copy it exactly as shown, including the port number if one is listed, and share it with your friends.
If you are self-hosting on your own PC
You need two different addresses depending on who is connecting:
For players on your own Wi-Fi network: they need your PC's local IP address. On Windows, open Command Prompt and run ipconfig, then look for "IPv4 Address" under your active network adapter. On macOS, open System Settings, go to Wi-Fi (or Network), and the IP address is shown next to your active connection. On Linux, run ip addr or hostname -I.
For players outside your network: they need your public IP address, the one your internet provider assigns to your whole household, not just your PC. The simplest way to find it is a lookup tool like whatismyipaddress.com, which shows the public address your connection is currently using. Note that this address can change periodically unless your ISP gives you a static IP, which can break things for returning players, a dynamic DNS service is the usual fix for that.
If you are running a LAN world
If you used Minecraft's built-in "Open to LAN" feature rather than a dedicated server, the game generates a random port each time and displays it directly in the chat window on the host's screen, for example "Local game hosted on port 47892." Other players on the same network can then join using the host's local IP address plus that port.
A quick sanity check
Once you have an address, you can confirm the server is actually reachable before asking friends to try, using a Minecraft server status tool, which will show whether the server responds and how many players are currently online.
Making this easier going forward
Self-hosted setups mean chasing down a changing public IP every time your router reconnects, which gets old fast. A hosted server sidesteps all of this by giving you one address that stays the same for as long as the server exists. Tick Hosting's free plan shows your server's address front and center on the dashboard from the moment it is created, no ipconfig required. Get one at Tick Hosting's pricing page.