If you want to uninstall windows this is used instead of deleting partitions manually to avoid human error + writing a whole dedicated guide to just uninstalling.
If you want to relock your bootloader you'll need your partition table to be stock.
Important
There is a very small chance this guide might not work if your partition table is completely fucked up. If you find yourself not being able to boot to recovery / Android after, you will have to reflash your device with EDL.
You can find a guide on how to use EDL here
Hold the volume down + power button while the phone is turned off, or run the following command while it is booted
adb reboot bootloader
Replace
path\to\gpt_both0.bin
with the path to the gpt_both0.bin file.
fastboot flash partition:0 path\to\gpt_both0.bin
fastboot -w
Note
If erasing userdata fails, reboot to recovery and wipe all data there instead