Unfortunately, as far as I understand it, not really. NSO and for sure many other companies offering similar spy software use multiple 0-day exploits to get into your device.
At least for the Pegasus one, a system restart seems to do the trick in removing it in most cases, although there are some reports on surviving even a factory reset on some phones…
The other question is, if you are not a person of interest like a high-ranking politician or journalist, you are most likely not going to be a target of an attack. On the other hand, you never know… and that’s the really scary part.
Yup, the rabbit hole is quite deep. That’s only the people we know to have been targeted by this version Pegasus, I’m sure the dark figure is much higher.