When you delete data, it’s no longer accessible through the iPhone interface, but it isn’t erased from iPhone storage. To remove all of your content and settings from storage, erase iPhone. For example, erase iPhone before you return your old device to the help desk. If you want to save your content and settings, back up iPhone before erasing it.
You can erase iPhone from Settings . If you’re unable to open Settings, you can use a computer to erase iPhone.