IP itself does not guarantee to deliver data correctly. It leaves all issues of data protection to the transport protocol. Both TCP and UDP have mechanisms that guarantee that the data they deliver to an application is correct.
Using the IP layer the correct destination of the packet is identified and delivered. The Transport layer protocols(TCP/UDP/SCTP) check if the data delivered are correct using Check sum mechanism. However if the destination IP is not alive, the packet is hopped by decrementing the TTL field and when it becomes zero, the packet is lost and undelivered. If the Transport layer is UDP the source doesn't know of the failure in delivery of the packet