That is the definition of a router.
Problem is the boxes you buy in the stores are not actually routers even though every box says that. Those devices are designed to connect a single lan network to the internet. They are better called gateways.
What you need is a true router. There might be a consumer grade "gateway" that has the simple ability to route between 2 networks but it would take massive digging though the details.
The exact solution will depend on what other functions you need.
The general solution when used inside a single office to connect different lan networks is to use a layer 3 switch. This is in a way just another name for a router but there are small difference that I will ignore. Layer 3 switches tends...