the data link layer
Imagine your package has a destination address on the far side of the country, but right now it is sitting in a local sorting van that only travels to the next town. The van driver does not care about the final address; the driver's whole job is to get this load safely from here to the next stop and hand it over. The data link layer is that local hop. The network layer worries about the end-to-end journey across the whole Internet; the link layer worries about getting the bits across exactly ONE wire, fiber, or radio hop, from one node directly to the next node attached to the same link.
Concretely, the link layer takes a packet handed down from the network layer and wraps it in a frame: it adds a header in front and often a trailer behind, giving the bits a clear beginning and end, a source and destination link address, and usually an error-check field. It then hands the frame to the physical layer, which actually pushes the bits out as signals. At the other end of the link the receiver's link layer pulls the frame apart, checks it for damage, and passes the recovered packet up. It also decides who gets to talk when several devices share one wire or one slice of radio, which is the job of its media access control sublayer.
Why split this off into its own layer? Because every link is different. The hop from your laptop to the Wi-Fi router, the hop across a fiber backbone, and the hop over a copper cable each have their own quirks, error rates, and rules for sharing the medium. By giving each link type its own link layer (Ethernet, Wi-Fi, and so on) while keeping the same network layer (IP) above, the Internet can run identical packets over wildly different physical hops. A common honest point: the link layer delivers from node to adjacent node only; it does not, and is not meant to, get your data across the whole Internet.
You open a web page on a laptop joined to Wi-Fi. The first hop, laptop to wireless router, is handled by the Wi-Fi link layer; the router's hop out to the fiber modem is handled by an Ethernet link layer; the hop across the ISP is handled by yet another link layer. Same IP packet inside, three different frames around it.
One end-to-end packet rides inside a different link-layer frame on each hop.
The link layer is per-hop, not end-to-end: a frame is built fresh and discarded at each hop, while the IP packet inside survives the whole journey. Do not confuse a link (MAC) address with an IP address — they answer different questions.