There are many ways to do this. Some protocols treat UDP like AOL CDs--it doesn't matter if the post office forgets to to deliver the one you got today, because you'll get another one tommarow.
A good example protocol where it does matter is TFTP (RFC 1350) (which is very different from regular FTP). It solves it with a challenge-response mechanism. The sender sends packet 1, and the receiver acks it. Then the sender sends packet 2, and so on. If a packet is lost or comes out of order, the sender is expected to resend after a timeout.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.