If you are experiencing issues with your Sony Xperia Z, then follow this tutorial to do a hard factory reset to fix problems you may be experiencing.  A hard-reset will erase your data, and take the phone back to brand new state.  A hard reset can fix device freezing or not responding.   xperia-z-factory-hard-reset

To do a a soft reset Go To settings >
  1. Choose “Backup and reset“.
  2. Select “Factory Data Reset“.
  3. Select “Reset Phone“.
  4. Confirm this choice by tapping “Erase Everything“.

To do a Hard reset then follow the instructions below. 1. If your phone is turned off, just press and hold the Volume Up and Volume Down buttons. 2. Then press and release the Power button (but keep on holding the volume buttons). There should be a menu that will appear on your phone. 3. Press the Volume down button to Recovery option. Press the Volume Up to select (if that doesn’t work, use the Power button to select). 4. An Android logo will appear. Press the Volume Down and Volume Up button together and a recovery menu should appear. Use the Volume buttons to move to the Wipe data/Factory reset option and then press Power to select. 5. Use the Volume Down key to choose Yes and press the Power button again to select.