This is the eighth zero-day vulnerability that Apple have released updates for this year. Macs on Big Sur should be updated to macOS 11.7, Macs On Monterey should be updated to macOS 12.6.
On iOS and iPadOS devices you have a choice, you can either update to 15.7 or 16.0. My advice would be 15.7 as 16.0 could have the not uncommon niggly bugs found in first releases. Whatever you choose, you should do it immediately as there have already been active exploits of these flaws.
9to5mac published a very good article on this and you can read it here.