There are more ways than one to reset your mobile device. Follow these steps if you wish to format it.
Option 1: Make sure the battery is properly charged. Turn on the device. Make sure to backup all your important data. Go to Settings > Backup and Reset > Factory Data Reset > Reset Phone. Choose erase everything to continue and confirm that you are ready to reset the phone.
Option 2: Make sure the battery is fully charged. Backup your important data. Turn off the device. Press and hold together: Power Button + Volume Up Button for several minutes. Follow the menu and chose to hard reset your Sony Xperia.