You can change your passwords and enable two-factor authentication for your Apple ID account and any other accounts you use on your iPhone by going to the respective settings and following the instructions. For example, to change your Apple ID password, go to Settings > [your name] > Password & Security > Change Password. To enable two-factor authentication for your Apple ID account, go to Settings > [your name] > Password & Security > Two-Factor Authentication and turn it on.