Just to be sure, I am not responsible for any bricks or damage to your smartphone. Use this guide at your own risk.
There are restrictions in flashing firmwares with a locked bootloader! Install only the correct one or the installation will fail:
Redmi K20 - Chinese firmware
Mi 9T - Global firmware
Latest XiaoMiTool V2 (Thanks Francesco Tescari)
Debug USB (you can enable it in Developers settings)
1- Download and install latest XiaoMiToolV2 from the provided link and run it
2- Choose a region (I selected Europe)
3- Connect the phone with Debug USB enabled and choose "My device works normally, I want to mod it"
4- It will start checking connected devices
5- Your phone will reboot to fastboot mode and the device information will be collected
6- Your will reboot to Recovery mode in which you will need to select "Connect with MiAssistant"
7- Select "Official Firmwares" and it will start searching them
8- Select the official xiaomi firmware that you want (Global/CN)
9- Your data will be deleted
10- Download the firmware
11- At the end of the download it will reboot in "Connect with MiAssistant" mode and the installation process wil begin
12- A success message will appear and the device will reboot with the new firmware!
Dima_Apatity of the 4PDA forum for steps and screenshots
Francesco Tescari for XiaoMiTool V2