Here are the guides on how to perform a soft reset and a factory reset on your Sony Xperia Z2 Tablet.
In situations when your device ceases to respond, you can force it to restart. No data or personal settings should be deleted in this instance. Remember, if your battery is low, the device may fail to restart properly. If this happens, simply connect the device to a charger and then try to restart again.
Detatch the cover of your micro SD slot.
Use the tip of a blunt, thin object to press down the small red button until the device shuts down.
Turn the device back on.
To avoid any damage to your device, make sure that you do not restart your device when a procedure to reset it is in progress.
Make sure you have backed up any important data before a factory reset
Tap the icon that looks like a box made of three by three dots.
Find and tap your ‘settings’ then ‘backup & reset’ then select ‘Factory data reset’
Delete all and data from your storage by selecting the ‘erase internal storage checkbox’
Tap the option to ‘reset phone’
Confirm by tapping ‘Erase everything’.