You flash phone's Stock ROM by means of ADB Sideload method what of course requires you have USB-Debugging enabled in phone's Android -> Settings -> Developer options before and phone re-booted afterwards.
To flash a suitable Custom ROM it's required by means of Fastboot to boot into a suitable Custom Recovery what of course requires you have successfully unlocked phone's bootloader before - that requires you have applied OEM Unlock in phone's Android -> Settings -> Developer options - , and afterwards flash the suitable Custom ROM from within the Custom Recovery's menu.