Avoid url and data sniffing

Hi, I use a wifi in a public place I think that is protected by pfsense or something like that. Now someone told me that can track my url and data because of the firewall.
I’d like to know how to avoid this, is a Vpn a solution for my problem?
Thanks

For public Wi-Fi internet I use free 1.1.1.1 app https://one.one.one.one/

is a Vpn a solution for my problem?

Yes.

but a firewall like pfsense can sniff what url you are visinting, I guess.

What do you mean “sniff your url” if you’re using the router you’re connected to as DNS because you’re just using DHCP you’re literally asking the router “hey what the IP address for this website”.

I mean it can list all url in pfsense, hence I access using a code, so it’s easy to get my ip and so list all my visit site. I want to be clear, I don’t want make something illegal, but I dont want to that someone knows which youtube videos I watch, thanks

You’re making very little sense.
When PfSense is acting as your DNS resolver yes it knows what servers you’re connecting to, but only the domain is used to fulfil a DNS request, not the entire URL.

Not sure what code you’re saying you’re going to use?

Using a VPN will hide your DNS requests from the router because it will no longer be resolving them (if all your traffic is going through the VPN then it can’t contact the router to resolve an address and has to use another DNS service).