How To Remove Your iCloud Account from an iPhone You Have Already Sold
Even if you have already parted ways with your phone, you can erase it remotely for protection of your own privacy and to allow the new owner to fully utilize the device by following these three easy steps:
Step 1: On your computer or phone, go to iCloud.com and log in with your credentials. Click on Find iPhone.
Step 2: On the dropdown menu, select the phone you wish to erase and click Erase iPhone. You will once again need to enter your iCloud credentials
Step 3: Finish by clicking Remove from Account