One of the biggest criticisms of rooting is that it weakens your phone security. That is partly true — but with the right practices, a rooted phone can still be quite secure.
Use a root manager
Never root without a proper root manager like Magisk. It gives you granular control over which apps can get root access.
Keep Magisk updated
Security vulnerabilities get patched in updates. Keep Magisk itself and any modules you use up to date.
Use a firewall
AFWall+ is a root-required firewall app that lets you control which apps can access the internet — something you simply cannot do on a non-rooted phone.
Banking apps
Most banking apps check for root now. Use the Shamiko module or DenyList in Magisk to hide root from sensitive apps.