You could go to https://icloud.com/
, then to Find iPhone
. Then click on All Devices
at the top and select the device you want to erase.
Then, it should give you an option to erase your device.
Of course, be careful, because a mistake will result in the wrong device getting erased.
Also, once the erasing is done, you will need to remove the device from the account by selecting it again and choosing Remove from Account
, otherwise it will be locked to your account.