

Mostly avoid downloading and running packages from sources you don’t trust. And if you’re going to run something you don’t fully trust, try to run it sandboxed (like firejail or a vm, for example). Linux is generally safer than Windows because a lot of malware are created to exploit Windows weakness… also, if you use Flatpak (sepecially verified ones) or your distro package manager, you will hardly get infected.

I don’t know if Ubuntu has fixed it, because trying to enforce their Snap store was intentional. But I can’t say for sure because there have been years that I don’t use it.
But yeah, for anyone using it, I’d recommend to just remove Snap entirely, since it’s totally unnecessary and goes against pretty much every Linux core concept.
Or just use something like Kubuntu or Linux Mint, that have Ubuntu under hood but are more community driven instead of relying on Canonical.