How to completely wipe an android phone through a PC?
If you can boot your device in bootloader mode, you can use fastboot for this task (see our fastboot tag-wiki for details):

fastboot -w            # erase userdata and cache (and format if supported by partition type)
fastboot format cache  # format cache and userdata
fastboot format userdata


This does not make it completely impossible to recover any data with forensic tools, but makes it sufficiently hard to not being worth the effort – unless data stored on the device is that valuable that one would invest some thousand dollars to get it.

Of course this requires the appropriate tools (and on Windows, also the drivers) to be installed on your computer.