I need the device model and Android version to give exact steps; I'll assume a common Android phone with an unlocked bootloader path via fastboot. Steps below use Termux on-device and require a PC only if your device blocks fastboot over USB from the phone.
Step 1: Enable Developer Options and USB Debugging unlock bootloader using termux hot
Grant Storage Permission: You might need to grant storage permissions to Termux. You can do this by going to Settings > Apps > Termux > Permissions > Storage. I need the device model and Android version
pkg install -y git to install Git.git clone https://github.com/LineageOS/android-bootloader.git to clone the bootloader repository.cd android-bootloader../bootloader unlock to unlock the bootloader.fastboot oem lock command.