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