Apple recommends you turn on two-factor authentication for your Apple ID as an additional layer of security. When you set it up, you designate your trusted devices. Then, when you use your Apple ID to make a purchase, you are asked to enter the verification code sent to your trusted device.