To sign out of iCloud on all of your devices at once, you can head to iCloud's website and change your password.
You can turn off specific iCloud features, or iCloud as a whole, on most Apple devices and on a Windows computer.
• Factory resetting erases all data, apps, and settings from your iPhone, returning it to original condition • Always back up your device before performing a factory reset to avoid permanent data loss ...