Post [Q] How to Wipe All Data

I currently have an HTC one (M7) on Verizon and will be moving over to T-mobile and upgrading to the HTC one (M8). In order for T-Mobile to pay my Verizon ETF I need to trade in my old HTC one (M7). Is there any specific process I need to do besides a factory reset in order to wipe all personal data from my phone? I especially can not have any of my work email on my phone when I trade it in.

Thank you for the help!