Even if you know your port and public IP, there are a few things you need to consider if you want to host a server.
Your router (the thing that connects your home network to the internet) has a firewall that blocks any incoming traffic that isn't a response to some outgoing traffic. This is to protect your home network from possible attacks from the outside.
However, when you set up a server, you're expecting people from the outside connecting to it. As a result, you must tell your router that connection attempts from the outside should be allowed. There are 3 ways to do this:
Port forwarding: You are telling your router that only messages to a specific port or range of ports is allowed to go through the firewall, and should be forwarded to a specific computer (your server). This is the recommended approach as it limits the range of attacks that can be launched against your server.
Automatic port forwarding (UPnP): Same as before, but much more convenient as your devices can now open ports on their own. This can leave your home network vulnerable if a malevolent actor somehow gains access to your home network. Examples include but are not limited to: Malware, hacked WiFi, insecure devices that forget to close ports when they're done, etc. Note that the software (the Terraria server software) must support this feature to make use of it.
Demilitarized Zone (DMZ): The DMZ is a zone in your home network that is fully open to the outside. By putting your server in the DMZ, you are essentially leaving it outside of your firewall's protection, enabling anyone to access your server using any port. You should only use a DMZ if you know exactly what you're doing, both in terms of networking as well as in terms of security. In some home routers, the DMZ is not isolated from your home network. In that case, if your DMZ gets compromised, it'll compromise the rest of your home network.
How to enable/disable or configure port forwarding, UPnP or DMZ depends on your router.
Remember that your server may also have its own firewall, so even if you've opened a port on your router's firewall, your server may itself be refusing the connection. The solution here is to allow your software (the Terraria server software) to bind to the ports it needs.
Dynamic IP addresses and leasing
Due to the limited amount of IPv4 addresses (and IPv4's enduring popularity), the public IP address you have now may change at any moment. When and how often it changes depends on many factors.
If this happens to you, your friend will need to know your new public IP address to connect again. To avoid this, you can use a so-called dynamic Domain Name System (dynamic DNS, or DDNS). Your server will periodically contact the DDNS server, which will assign a URL (such as example.com) to your current public IP address.
For additional safety, it's recommended to request a certificate from a Certificate Authority (CA) such as Let's Encrypt, so your friend can be sure they're connected to your server, and not to some malicious server pretending to be you.