You need a router. Opnsense is a router. You could buy a different one but if you want to go the route of opnsense, why would you get a different one? It doesn’t need much power, unless you’re trying to route gigabits - and then any router will cost you.
You also need a vlan aware switch or a second switch (and the router needs more than one local port). Just a switch won’t work; you need the firewall rules between vlans and internet to make it worthwhile.
My opnsense has ports to WAN, LAN, and IOT (cameras). LAN connects to a switch. IOT connects to a different (poe) switch that runs the cameras. I have a firewall rule on IOT blocking all outbound traffic, and allowing inbound from LAN.