Is it better to use a switch or a router?
You can't really compare network switches and routers to determine which is the best, because they perform different functions in the home network.
As you know now, everyone should have a router to connect to the modem. You don't want to have a switch in its place.
A better question is whether you need a switch in addition to a router instead of just one.
If you have multiple devices that want to connect to the network using Ethernet instead of Wi-Fi, it is recommended to use a network switch.
Although this situation is rare now, some devices do not have built-in Wi-Fi, so you have no choice but to use Ethernet. If you have several devices that work like this, you may find that the Ethernet ports behind the router are not enough.
Not to mention smart home hubs that rely on Ethernet connections.
I tried to plug them into my network switch to save the use of ports on the router, but found that they did not work; They must be connected directly to the router.
If you use these ports when connecting personal devices (such as game PC), you will find that your available ports will soon run out.
If you have many devices in your home, or just want to take advantage of the better performance that Ethernet usually provides through Wi-Fi, it is worth considering adding a network switch to your home network.
But again, except for your router, it has not been replaced.
Final idea
In short, although it is technically possible to connect a network switch to a modem instead of a router, this is not recommended.
The main reason is that your ISP only proves a few IP addresses. Usually, this is just an IP address, but if you are lucky, you may have two or three.
This is called your public IP address.
Once all available public IP addresses are exhausted, any other device you connect to will not be able to receive IP addresses, communicate on the network, or access the Internet.
If you only have a public IP address, even if you have multiple devices connected to the switch, only one device can access the Internet.
Connecting a router to a modem means that it is assigned a public IP address, and then allows you to connect multiple devices at the same time by assigning each device its own private IP address.
Because of the built-in firewall, they also provide better network security and can shield the IP address of any device that is not connected to the network safely.
In any case, use network switches, because they are very useful, but make sure they are used outside the router, not replacing it.