TCP vs UDP
TCP sets up a connection (the SYN, SYN-ACK, ACK handshake) and guarantees reliable, ordered delivery with acknowledgements and retransmission - good for web, email and file transfer. UDP is connectionless with no guarantees but very low overhead - good for DNS lookups, DHCP, voice and video where speed beats perfection.
Ports identify the service
An IP address gets you to the right host; the port number gets you to the right service on that host. A web server listens on TCP 443 (HTTPS); an SSH server on TCP 22. One server can run many services at once because each listens on its own port. The client picks a random high 'ephemeral' port as its source.
Ports worth memorizing
20/21 FTP, 22 SSH/SFTP, 23 Telnet, 25 SMTP, 53 DNS (UDP and TCP), 67/68 DHCP (UDP), 80 HTTP, 110 POP3, 123 NTP (UDP), 143 IMAP, 161 SNMP (UDP), 389 LDAP, 443 HTTPS, 445 SMB, 3389 RDP. Secure the ones you don't need - an open port is an attack surface.
Why this matters for troubleshooting
'The website loads but email doesn't' is usually a port/firewall problem, not a routing one. Knowing which port a service uses lets you check whether a firewall rule permits it, whether the service is actually listening, and whether the right transport (TCP vs UDP) is allowed.