In short, a router connects networks and routes traffic between them. A modem connects those networks to the internet.
Let’s use your home-network as an example;
Your router has one connection to the internet, and one to your local network. It usually has a built-in switch that lets you connect a few wired devices. These ports are usually marked with number 1, 2, 3 etc. These days, most of them also contain a wireless radio that allows you to connect devices through Wi-Fi. The role that your modem plays in this; a bridge between your local network (router) and the internet.
These days, most people have an all-in-one device. ISPs (Internet Service Providers) sometimes give these fancy names, but it’s essentially a modem and a router in one device.