Open Settings
Tap your Apple ID name at the top
Scroll down and tap Sign Out
Enter your Apple ID password
Turn off Find My iPhone if prompted
Choose the data you want to keep on the iPhone
Tap Sign Out again to confirm
If you want to remove iCloud from the device completely, erase the iPhone after signing out
Go to Settings
Tap General
Tap Transfer or Reset iPhone
Tap Erase All Content and Settings
Follow the on-screen steps to complete the reset
