As suggested earlier, cancel the subscription. Until that has been done and the subscription has fully ended (not just cancelled) you cannot close the account. This support article explains how to cancel a subscription from Apple on an Apple mobile device, Mac, PC, and online (see the Android section) ➔ Cancel a subscription from Apple - Apple Support
Click on this link to read about how to deactivate your Apple ID account --> How to deactivate your Apple Account - Apple Support You may wish to first deactivate an account for a while just to make sure you truly have no more need of it. Once an account has been deleted, all purchases made with it can no longer be re-downloaded.
If you wish to proceed directly to cancelling your Apple Account (formerly “Apple ID”) carefully and thoroughly read this support article about what happens and how to delete an Apple Account—> How to delete your Apple Account - Apple Support
and the consequences of deleting an Apple Account. For example:
"Make sure that you sign out of all your devices to avoid issues with apps that use your Apple Account or iCloud. After your account is deleted, you can’t sign out of iCloud or turn off Find My iPhone Activation Lock on your devices. If you forget to sign out, you might not be able to use your device when your account is deleted."
As for those messages, are you sure they are real? Apple won't send you warnings about a compromised account, they will just lock it if they suspect something is abusing the system. Phishing scams are very common. Criminals are getting very good at imitating Apple messages. Start here about recognizing phishing and scams —> Recognize and avoid social engineering schemes including phishing messages, phony support calls, and other scams - Apple Support