Two-factor authentication applies an extra layer of security to your Apple account by requiring a password and verification code or a physical security key. Here’s how to set this up.