An IP address gets a packet to the right computer, but a computer runs many programs at once. Ports pick the program. A port is a 16-bit number, 0 to 65,535. Servers listen on agreed ports: web servers on 80 (HTTP) and 443 (HTTPS), for example. Your side picks a random high port for each connection, so replies come back to the right browser tab.
An address and a port together, like 203.0.113.7:443, name one end of a conversation. Ports 0 to 1023 are the well-known ports, set aside for the common services.
TCP (Transmission Control Protocol) gives programs a reliable stream. It numbers every byte, the receiver acknowledges what it gets, and anything not acknowledged in time is sent again. Data is put back in order before the program sees it. TCP also slows down when the network is busy, so everyone gets a share.
Before any data, TCP sets up a connection with a three-way handshake. The client sends SYN ("let's talk, I'll start numbering here"), the server answers SYN-ACK ("got it, here's my number"), and the client replies ACK. That costs one round trip before the first byte of data.
UDP (User Datagram Protocol) skips all of that: no handshake, no acknowledgements, no resending. Each message is sent once and may be lost. That sounds worse, but it's faster and lighter, and for some things old data is useless anyway: in a video call or a fast online game, a late packet is better dropped than waited for. DNS lookups use UDP too, because they're one small question and one small answer.