If you haven't jailbroken your iPhone, it's not possible.
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)
See who has access to your device or accounts
See who has access to your device or accounts – 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
Report and block spam in iCloud mail - Apple Support
👉 If you think your Apple ID has been compromised
If you think your Apple ID has been compromised - Apple Support
Identify legitimate emails from the App Store or iTunes Store
Identify legitimate emails from the App Store or iTunes Store – Apple Support (UK)
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
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
- if you see devices that don't belong to you, delete from your account.