Zainab, most of the time touch screen failure is caused by damage to the screen, which may or may not be visible. Although there can be other causes, those would be related to components on the motherboard and would require expert board-level repairs that most of us can't do at home.
As a result, the best recommendation I can give you is to try software solutions first, such as doing a hard reset of your phone, and possibly even wiping it completely and doing a factory restore on it. If none of those solutions help, then it's fairly definite that it is a hardware problem and will most likely be fixed by replacing the screen. A guide is available to give you step by step instructions on how to replace it. You can find the screen on many sites such as AliExpress, Amazon or eBay, depending on your location and parts available to you.
[guide|125870|Xiaomi Mi 9 AMOLED & Digitizer Replacement - iFixit Repair Guide|new_window=true]
Best of luck on your repair; let us know how it goes.