Custom recovery such as TWRP allows a Samsung Galaxy S21 Ultra user to flash third party ROMs. Samsung stopped updating their flagship from 2021 but you can still flash a custom recovery onto it and enjoy latest features.

You will the to unlock bootloader and have latest version of magisk installed. When unlock bootloader, it will automatically hard reset your S21 Ultra. Also, installation of custom recovery is only possible if you have boot Ramdisk enabled. You can make sure whether you’ve Ramdisk installed or not by launching Magisk app.
Download the Magisk APK from their official GitHub.
Rename the .apk file extension to .zip, for example: Magisk-v2*.*.apk → Magisk-v2*.*.zip. If you have trouble renaming the file extension (like on Windows), use a file manager on Android or the one included in TWRP to rename the file.
Flash the zip just like any other ordinary flashable zip.
Reboot and check whether the Magisk app is installed. If it isn’t installed automatically, manually install the APK.
Keep in mind that installing Magisk will trip KNOX and void warranty. We are sure warranty is already over since the device is 3+ years old.