how to format?

Open your device’s Settings option.
Find factory reset option in your Device
It may be in Under Privacy or Backup and Reset option
Tap on Reset device to delete all data and restore your device factory settings.
Conform restore process by selecting erase everything option.