Sign in to icloud.com/#find with your Apple ID (the one you use with iCloud). If you’re using another iCloud app, click the app’s name at the top of the iCloud.com window, then click “Find My iPhone”.
Click All Devices, then select the device.
Click “Erase Device”, then enter your Apple ID password. Because the device isn’t lost, don’t enter a phone number or message. If the device is offline, the remote erase begins the next time it’s online. You’ll receive an email when the device is erased.
When the device is erased, click “Remove from Account”.