I understand that you have a question about making sure that the information on your iPhone is secure. Account security is very important, and I'd be glad to help by providing you with some information.
You can start by going through these steps in this article about what to do if you think your Apple ID being compromised. It will also guide you through changing the password for your Apple ID.
If you think your Apple ID has been compromised
If after going through these steps you still want to restore the iPhone, this article will guide you through those steps. If you are going to want to restore any of your data back to the iPhone, you'll want to create a backup first.
How to back up your iPhone, iPad, and iPod touch
Restore your iPhone, iPad, or iPod to factory settings
Thank you for using Apple Support Communities.
Have a great day!