you should be able to get in system OTA's even while being rooted so long as you didn't modify /system in any way.
If you want to do that you need to first restore the stock boot.img, typically done by going to magisk -> restore images, for details refer to the
guide for the pixel 6, check the automatic OTA section.
Though it might be easier and safer to sideload the OTA instead, you can find details for that in the same guide under the sideload OTA section.
As far as I understood it doesn't matter if you still have modules installed and a rooted boot.img when you sideload, but if you want to be super safe you could always just disable all modules and flash stock boot.img
After sideloading OTA you have to re-root, so keep a magisk patched boot.img ready to boot from.
unroot is just as easy as flashing stock boot.img or uninstalling through magisk.
I'm not exactly sure what the difference between the "uninstall" and "restore images" option is in magisk.
"restore images" is supposed to restore your stock boot.img if you previously rooted by doing "direct install" in magisk.
And I suppose uninstall does the same but also removes all of magisk instead of only unrooting?
Don't take my word for it, it's just a guess.
Relocking bootloader requires you to be 100% stock, and iirc that also requires you to wipe your device, but not sure about that one.
I'd recommend you use pixel flasher for that as it leave little room for error, typos and the like.
In essence you just download the latest factory image from google, flash everything including wiping data and relock bootloader after that.
That said, using Pixel flasher or android flash tool with the wipe options checked do the same for you without needing to type out commands and navigate your downloaded archives.
Is it necessary to flash to both slots?
I don't know, hopefully someone else can answer that one.