To keep your Apple ID account secure, see the following Apple articles:
Manage and use your Apple ID
Manage and use your Apple ID – Apple Support (UK)
Recognize and avoid phishing messages, phony support calls, and other scams
Recognize and avoid phishing messages, phony support calls, and other scams - Apple Support
Phony "tech support" / "ransomware" popups and web pages
Phony "tech support" / "ransomware" popup… - Apple Community
Identify and filter junk mail in iCloud
Identify and filter junk mail in iCloud - Apple Support
If you think your Apple ID has been compromised
If you think your Apple ID has been compromised - Apple Support
Set up iCloud Keychain
Set up iCloud Keychain - Apple Support
Create a strong password for your Apple ID, It is best if your password consists of eight or more characters and include upper and lowercase letters, and at least one number. You can also add extra characters and punctuation marks to make your password even stronger.
Never provide your password, passcode, security questions, verification codes, recovery key or any other account security details to anyone else. Apple will never ask you for this information.
See also the following Apple articles:
About the 'Trust This Computer' alert on your iPhone, iPad, or iPod touch
About the 'Trust This Computer' alert on your iPhone, iPad, or iPod touch - Apple Support
Authorize or deauthorize your computer for iTunes Store purchases
Authorize or deauthorize your computer for iTunes Store purchases - Apple Support
Get a verification code and sign in with two-factor authentication
Get a verification code and sign in with two-factor authentication - Apple Support
Two-step verification for Apple ID
Two-step verification for Apple ID
Check your Apple ID device list to see where you're signed in
Check your Apple ID device list to see where you're signed in - Apple Support