Go to Settings﹥iTunes Store﹥… It should list your Apple ID already. If not, then you may want to reset and set it up again. Reset or restore your Apple TV to its factory settings - Apple Support.
A signed in and registered Apple TV is required for AirPlay functionality.
Use the password field for both the password and the verification code, as detailed in the previous reply.
Signing in for iCloud services is no longer supported, so skip that. iCloud services are not used for AirPlay, so this doesn’t matter for the AirPlay functionality.
If you are successfully signed in, but Settings﹥General﹥About﹥ says “Activation: Failed”, then please see user RKG61’s workaround: discussions.apple.com/thread/253315520.