On a trusted computer (not your iPhone), log into your iCloud account and change the password, set up 2 Factor Authentication which will further secure your account from unauthorized use.
Installed the latest version of iTunes, then proceed to
Restore your iPhone.
Guide:
How to factory reset an iPhone (every generation)
Know Your Mobile - Resetting Versus Restoring Your iPhone
Resetting your iPhone is the “lighter” version of formatting your device back to factory settings. A reset can be done directly on the iPhone itself--right in the Settings app--and doesn’t need to be connected to iTunes on a Mac or PC to complete.
When resetting your iPhone you have the option of resetting all the settings on the device to factory default or just the network, keyboard dictionary, home screen layout, or location and privacy settings. These settings are the preferences which make your iPhone yours: network passwords, icon arrangement, system and app settings, and the like.
Restoring your iPhone is the “nuclear” version of formatting your device back to factory settings. A restore will wipe everything from your iPhone--settings, apps, the OS, and even the firmware itself. If you want the iPhone to be as close to the way it was when you first opened it from the box you want to restore it.
Source:
Reset or Restore Your iPhone –– What's The Difference?
If the issue persists, try the official Apple Community:
Official iPhone Support Community - Apple