[Xiaomi Poco F4 GT /  Redmi K50 Gaming] Yusuf T-Deen:
Hi, this is a small guide I made to unlocking a Xiaomi/Redmi phone running MiUI. Please credit me or link this post and like it if it helps you :)

BACKUP all your data as your phone will be reset.

Xiaomi phones running MiUI do not unlock the regular way(going to developer options, enabling OEM unlocking, then connecting the phone to the PC in fastboot mode and typing "fastboot oem unlock").

Note: Xiaomi phones running stock Android(from Android One program) can unlock normally.

To unlock the bootloader on a phone running MiUI, there are 2 parts, the first is on the phone, second on the computer. The first part(phone) is as follows:

1) Create a MiUI account & link a working SIM to the account

2) Add the specific device to your account

3) Authorise that device for unlocking the bootloader

SIGNING INTO YOUR MI ACCOUNT is extremely important & you can lock your phone if you haven't properly set it up and added the phone to it, so please look that up and do it very carefully.

Once you sign in to your Mi account on the phone, it will automatically be added to your list of devices. DOUBLE CHECK AND CONFIRM THIS BY GOING TO YOUR MI ACCOUNT.

To authorise your device, make sure Find my device & other Xiaomi services are off, then go to developer options, then Mi Unlock Status.

To complete this step, the SIM has to be in the same phone and mobile data has to be switched on and working. THIS STEP WILL NOT WORK OTHERWISE. So again, make sure your SIM is activated, you can connect to the internet & you have sufficient balance and a data plan.

At the bottom, you will see a button that says "add device" or something. Follow the instructions (turn off Wi-Fi, turn on mobile data) and then click the button.

You will see a toast message that says "Preparing to add device" and another toast "Device added successfully" or an error message. THESE ONLY APPEAR AS TOASTS not notifications, so keep your eyes on the screen (and keep it awake) otherwise you may miss them.

Once you see the "Device added successfully" toast, it means your device has been authorised successfully. DO NOT TAP THE ADD DEVICE BUTTON AGAIN OR TRY TO ADD YOUR DEVICE AGAIN.

Your device will be given a timer (usually one or two weeks) before it is authrorised and receives the code to unlock. Unfortunately there is no way around this and you have to wait.

Trying to add your device again will only reset the timer, so just add it once and wait.

Now in developer options, allow "OEM unlocking" and "USB debugging". THESE ARE VERY IMPORTANT AND THE NEXT STEPS CANNOT PROCEED WITHOUT THEM.

Now you need to use the computer for the second part:

You need to have ADB and Fastboot setup already(if you don't know how, look it up).

Download Mi Unlock tool from the official Mi website(https://en.miui.com/unlock/download_en.html) and set it up on your computer, and sign in to your account (again, MAKE SURE THIS WORKS PERFECTLY BEFORE PROCEEDING).

Connect your phone to your PC, while your phone is on. Your phone should show a prompt saying "Allow USB debugging from this computer?", so allow it and tick "Always trust this device".

If not, on your computer, open a CMD/Powershell window as an admin(shift & right click) or just hold Alt, then press F,S,A in that order. If you have properly installed ADB & Fastboot to work universally on your computer, it should run. If not, again, check everything before proceeding.

In the Powershell window, type "adb devices"(and press enter, obviously), which will run the daemon and show any ADB devices connected to your PC.

You should should see a short string(letters and numbers) which represents your phone.

To reboot into fastboot, you can use "adb reboot bootloader"(or just do it manually by turning off the phone, then holding power and volume down). You should see the fastboot screen show up.

Again, make sure fastboot works by typing "fastboot devices" and confirming that your device is still connected. You should see the same device ID.

IF EVERYTHING WENT SMOOTHLY, proceed. If not, check everything again.

By this time your Mi unlock tool should have recognised the phone in fastboot mode and will first check if you are authorised to unlock it.

THIS IS WHY YOU NEED TO LOGIN WITH THE SAME MI ACCOUNT & HAVE ALREADY AUTHORISED IT IN DEVELOPER OPTIONS. If not, this step will fail.

If you have followed everything properly, the unlock tool will show a progress percentage and you will see a corresponding bar on your mobile screen.

When it completes successfully, you will see a button on your PC to reboot your phone(if it doesn't reboot automatically). Wait till you see the MiUI logo(after the boot screen), then disconnect it from the PC.

That's it! Your phone should be unlocked. It will take a long time to boot up and will be factory reset, but after you set it up, you can go to developer setting and check it.

The OEM unlocking option should be greyed out and you will see "Bootloader is already unlocked". Mi unlock status should show unlocked.