Factory resetting your phone will erase all data on the device and restore it to how it was when you first bought it. As all data is erased, this will also remove any stalkerware, even if it’s hidden. If you decide to factory reset your phone, be sure to backup any important data first so you don’t lose it.