Yes, a factory reset on your phone will eliminate a hacker. Remember that this approach will delete all your data, including contacts, files, images, and third-party apps. Your phone will need to be completely reset to factory settings.