As part of my networking basics studies, I am still following Certbros’ Cisco CCNA 200-301’s playlist.
Below is how I captured my notes.
A computer's IP address is like the street address of an apartment building, guiding data to the correct device on a network. A port number is like the specific apartment number within that building, directing the data to the correct application or service running on that computer.
For example, when you browse a website, your web browser uses port 80 for unsecured connections (HTTP) and port 443 for secure connections (HTTPS). When you send an email, your email client uses port 25 (SMTP). A video game might use a different, specific port number to communicate with its servers. This system allows a single computer to handle multiple types of network traffic simultaneously without mixing them up.
A port number is always associated with an IP address and both work together to exchange data in a network. I.e. To connect to a server, an IP address determines the location of said server and the port determines which service that server wants to use 25 for mail, 21 for file transfer.