Make sure your device bootloader unlocked.
Unlock Redmi Note 7 Bootloder >> Read Now
How to Root and Install TWRP Recovery on Redmi Note 7
Install TWRP Recovery
Go to Settings > About Phone > MIUI version and MIUI Version 7 Times.
Now go to Settings > Additional Settings > Developer Options and check “OEM unlocking”
Extract ADB folder on your pc and navigate to that folder.
Hold Shift + Left click and select “Open command window here.”
Turn off your device.
Press and hold Volume Down + Power button until you see the Fastboot screen.
Connect your device to PC.
In CMD, type
fastboot flash recovery [twrp recovery name].img
After the process finishes, remove your device from the PC. Don’t turn off your device (this is important) and hold Volume Up + Power Button until you see MI screen.
TWRP recovery should boot now.
How to Root Redmi Note 7
Boot into TWRP Recovery (Turn-off your device. Press and Hold Power + Volume Up button until you see MI screen)
Go to Install > Select Magisk Manager Zip file and flash.