[HELP]Unifi AP + MT Switch + Router VLAN configuration

Hello,

Can anyone help me how to configure vlans correctly?
I can plug unifi APs to either switch or either router.
I need 1 management vlan, 1 iot trusted (with internet access), 1 iot untrusted (without internet access) and 1 guest vlan.

All VLANS can be made on different APs.

I don’t know basic stuff how to correctly configure vlans.

I have some iot stuff over erhernet in switch and other over wifi through Unifi AP.