The answer is simple – use antiviruses. It is advisable to use those that scan the links you are viewing and track performance problems with the iPhone.
In addition, Apple will soon have a new feature called Lockdown Mode, which can significantly spoil the lives of spies and hackers.
When starting Lockdown Mode includes the following security features:
In the Messages application, the preview of links and attachments in messages (except images) is disabled;
Incoming FaceTime calls from new users are blocked. Incoming invitations in other services from users with whom there was no previous contact are also blocked;
JavaScript JIT compilation is disabled. Individual sites can be added to trusted sites to ignore restrictions;
Shared albums in the Photos app are deleted, invitations to new shared albums are blocked;
The wired connection to other devices and accessories is interrupted while the device is locked;
Installation of configuration profiles is prohibited;
The device cannot register in the Mobile Device Management System (MDM)
The feature will be released as part of iOS 16, iPadOS 16 and macOS Ventura.