Note: If you type fastboot oem unlock on a new device and get an error, always try fastboot flashing unlock first.
For devices running older Android versions (typically Android 5.0 Lollipop or older), the command syntax was slightly different: unlock bootloader command free
Or in Android: Settings → Developer Options → “OEM unlocking” grayed out (means already unlocked). Note: If you type fastboot oem unlock on