How data in iphone securely removed remotely

The first step is making sure the service is on your device now. On your iPhone, go to Settings > iCloud.

Slide the switch to turn on Find my iPad, and it is on.

This can be useful in case you lose your phone, or sell it without remembering to wipe all the data. Assuming you had enabled this service, deleting everything is simple. First, log in to iCloud using your Apple ID.

Click All Devices at the top and select your iPhone from the list of devices.
Select Erase iPhone from the box that pops up on the top-right > click Erase in the next popup.

After you've clicked on Erase, a new button pops up, labeled Remove from Account. Click this, to de-link that phone from your account and prevent the next owner from accessing your data.

In case you sold your iPhone without deleting your data and Find My iPhone isn't enabled on your phone, then the best you can do is change the password of your Apple ID. This won't stop the next owner from accessing data already stored on the device, but it will make sure that they can't delete data from your iCloud account. Here's how to change your Apple ID password.

Visit the Apple website. Enter your Apple ID and click Next.

Now you can choose between email authentication or answering security questions to change your password. Choose the method you prefer, and click next.

You'll be asked to verify your birth date before proceeding. Fill in the details, and click next.

Answer the security questions and click Next, or follow the link that is sent to your registered email addresses.

Now you can enter your new Apple ID password, enter it again and click Reset Password.