If you hit uninstall in Magisk, there is an option to restore images. If you hit that, it leaves Magisk installed and restores the stock boot images. If that works for you, you just go ahead and do that, install the OTA, and go back to Magisk before rebooting and go Install > inactive slot. Done.
If it gives you an error that you don't have backup images, you just go ahead and uninstall Magisk, install the OTA, boot a patched image, and direct install Magisk. This will cause you to lose all your Magisk modules and settings though so it's not the ideal way to do it.