A modem is a device that connects your home or office to the internet. It does this by translating data from your computer or other devices into a format that can be transmitted over a phone or cable line, and vice versa.
A router is a device that connects your computer or other devices to a network, such as the internet. It does this by routing data between devices and networks, allowing them to communicate with each other.
In short, a modem connects you to the internet, while a router connects devices to each other and to the internet. Modems and routers often work together, with the modem connecting to the internet and the router connecting devices to the modem and each other. However, they are two different pieces of hardware with different functions.