It’s a scam. Apple will never contact you to inform you of an account or device lockout.
See >>> Recognize and avoid phishing messages, phony support calls, and other scams - Apple Support
Don’t respond to, or engage with, the message. Certainly do not, under any circumstances, attempt to contact anyone using the contact details that may have been provided.
Alerts of this nature are designed to scare the unwary into giving away sensitive information - or to fool you into doing something that you shouldn’t - usually to defraud you financially.
If you suspect that your AppleID has been compromised, follow the advice outlined here:
If you think your Apple ID has been compromised - Apple Support