TTL (or Time To Live) is a Layer-3 loop prevention mechanism. Every time a packet passes a Layer-3 hop, the TTL decrements with 1. Packets with a TTL of 0 before reaching their destination will be dropped or discarded.
ICMP protocol will ensure the sender receives a proper response of failure. In some cases this would be “TTL expired in Transit” on ISP networks, unless they block ICMP responses.
Don’t mix TTL with TTL for DNS. The latter is slightly different.