TCP and UDP are two protocols that, while belonging to the same family (namely, the transport layer of the TCP/IP model), differ fundamentally in their philosophy. Both have their place, but they pursue very different goals.
TCP is like a polite exchange of letters: Before anyone even says anything, they introduce themselves, acknowledge receipt, and acknowledge each message individually. TCP is connection-oriented, guarantees the correct order of data, provides retransmission in case of loss, and avoids congestion. This makes it ideal for anything that needs to arrive reliably and completely: web pages, emails, files.
UDP, on the other hand, is like a megaphone at a party: Whoever shouts something does so without regard for the consequences. There's no guarantee that the message has been heard or fully understood. UDP, on the other hand, is connectionless, extremely fast, and has less overhead. Perfect for applications where real-time performance is critical—for example, live streams, gaming, or internet telephony.
In short:
TCP focuses on security and accuracy, UDP on speed and simplicity. Depending on the application, you decide whether you prefer everything done correctly or everything done quickly.