VLANs are layer-2 constructs that logically divide a switch into multiple, virtual switches. Normally, you put a different layer-3 network on each layer-2 VLAN. Traffic from a VLAN must pass through a router in order to reach a different VLAN. You must consider the layer-2 and layer-3 aspects when setting up different VLANs.
For layer-2:
As Zac67 points out, you need a trunk from the router to the switch. Trunks with multiple VLANs must tag the frames in order for the devices on each end to distinguish which frames are for which VLANs. You can have a single VLAN with no tags, called the native VLAN. The devices will assume that any untagged frames belong to that VLAN. On some devices, the native VLAN must be VLAN 1, and that is normally the default untagged VLAN. On the switch access interfaces, you do not tag the frames, regardless of the VLAN. Most hosts do not understand frame tags, and because the tags add four bytes to the frame header, the tagged frames are dropped as damaged.
For layer-3:
The gateway for a network must be in the same network as the source network. A gateway is the host, usually a router, on a network to which traffic destined for other networks is sent. If the gateway is on a different network, you would need a gateway to reach the gateway. Each VLAN will have its own gateway address configured on the router in the same network as the network for the corresponding VLAN.