Monterey 12.0.1 supports the use of another Mac’s display over Wi-Fi or USB, provided that both models support AirPlay. Here’s how to use it.
Target display
Diagnostic, Recovery, Safe, Startup Manager, Verbose, reset SMC/NVRAM, firmware restore, Target Disk/Display, Single-User (SUM) in outline.
Although mainly straightforward, there are catches which can break the daisy-chain.
How to connect an Xbox or other device with HDMI output to use the Target Display mode of some models of iMac.