
This sounds like a phishing attempt.
Basically, an attacker sends you an email telling you that your account was compromised and provide you a link to logon to a spoofed page to capture your login credentials.
You will want to sign into iCloud. If you can get in, it is likely your credentials were not compromised. In any event, change the password and enable two factor authentication (2FA) for more security.
Most importantly, don’t reply to the email or click on any of the links. If you did, change your password immediately! If you check the email “From” address, it likely didn’t come from Apple. If they provided a link, check the URL; if it doesn’t go to the apple.com domain, it’s a definite sign of a phishing attempt.