This article explains how to use the Android Debug Bridge (ADB) app for Windows to block the bootloader of an Android device. Warning: This procedure may include formatting the device memory, so make a full backup of your data before continuing.
Steps
Part 1 of 2: Install Android Debug Bridge (ADB)

Step 1. Launch an internet browser on your computer
This guide is based on a Windows computer, but the process on a Mac is very similar

Step 2. Visit this URL

Step 3. Click on the ADB Installer v1.5.3 button
As of today, January 29, 2021, the one indicated is the latest version of the program. If "Latest version" appears next to a different version, click on that version.

Step 4. Click the Download button
It is green in color with an oval shape. The installation file in EXE format will be downloaded as a compressed ZIP archive.

Step 5. Double click on the file you just downloaded
The contents of the ZIP archive will be displayed.

Step 6. At this point, double-click on the installation file in EXE format present in the ZIP archive
The full file name should be similar to the following: "adb-setup-1.5.3.exe". A "Command Prompt" window will appear asking if you want to install the Android Debug Bridge and Fastboot apps on your computer.

Step 7. Press the Y button
You will now be asked if you want to install the Android Debug Bridge at the system level.

Step 8. Press the Y button again
You will now be warned that some drivers need to be installed.

Step 9. Press the Y button
After a few moments, the driver installation wizard window will appear.

Step 10. Click the Next button

Step 11. Click the Finish button
Now the Android Debug Bridge program is correctly installed on your computer.
Part 2 of 2: Lock the Bootloader
Step 1. Connect the Android device to the computer using a USB cable
If you don't have the USB cable that came with your device at the time of purchase, you can use a compatible one.
Depending on your Android device, you may need to install additional drivers in order for it to communicate properly with your computer's operating system. You can get all the necessary drivers directly from the device manufacturer's website

Step 2. Press the key combination ⊞ Win + S
The Windows search bar will appear.

Step 3. Type the command cmd
You will see the search results list which includes the "Command Prompt" app.

Step 4. Click on the "Command Prompt" icon with the right mouse button and choose the option Run as administrator
The "Command Prompt" will start with the system access privileges of the administrator account.

Step 5. Click the Yes button to confirm
A "Command Prompt" window will open.

Step 6. Type the command adb reboot bootloader and press the Enter key
The ADB program will start.

Step 7. Type the command fastboot oem lock and press the Enter key
This command is used to lock the bootloader of the Android device. If an error message appears on the screen, try using one of the following commands:
- fastboot flashing lock
- oem relock

Step 8. Type the command fastboot reboot and press the Enter key
The Android device will restart and the bootloader will be locked.