Do you want to resell the phone after or erase the data at any cost?
Destructive way:
https://www.youtube.com/watch?v=lBUJcD6Ws6s
Arguably less messy methods would be soaking in salt water or activating a strong emp near the device.
The storage device is a solid state so technically a magnetic field wouldn't affect it, but with it being an electronic an EMP creates an incredibly strong current in the device which renders the device inoperable, including the nand storage that it uses.
But those 2 methods will make the phone as useless as the first method, if you don't count a paperweight.
Nondestructive way:
The easiest way would be to get the phone repaired at your nearest phone repair shop and then reformat the device using its own tools.
FYI, it most likely costs more to repair than what its worth since the phone is now 6 years old.