Use TCP when correctness matters more than the last few milliseconds: web pages, APIs, file transfers, database connections, email. If a missing byte would corrupt the result, TCP is the default and correct choice.
The cost is latency and head-of-line blocking. The handshake adds a round trip, and because TCP delivers bytes strictly in order, one lost packet stalls everything behind it even if those later packets already arrived. On a lossy mobile link this hurts. It is also heavier than the alternative: per-connection state, buffers, and timers on both ends.
UDP is the alternative when you would rather drop data than wait for it: live video, voice calls, gaming, and DNS lookups. QUIC, which now carries HTTP/3, was built specifically to fix TCP's weaknesses. It runs reliability and ordering over UDP, folds the TLS handshake into the connection setup so a new connection costs zero or one round trip, and avoids head-of-line blocking across independent streams.
A practical gotcha: opening a fresh TCP connection per request is expensive. That is why HTTP keep-alive, connection pooling in database drivers, and reverse proxies all reuse connections instead of paying the handshake cost repeatedly.