Open Settings
Tap your name at the top
Scroll down and tap Sign Out
Enter your Apple ID password
Tap Turn Off
Choose the data you want to keep on the iPhone
Tap Sign Out again to confirm
Enter your iPhone passcode if prompted
Wait for the Apple ID to be signed out from the device
