Still, I recommend making a backup save before proceeding. However, it will not delete any personal data.
This includes erasing Wi-Fi passwords, Bluetooth devices, location settings, VPN configuration, keyboard settings, and much more. This process will reset your iPhone to its default configuration. Restart your iPhone, and the issue of your iPhone randomly asking for an iCloud password might no longer disturb you.
Enter your Apple ID, password, and follow the on-screen instructions. Toggle them on according to your preferences. After you’re done, your iPhone may stop asking for an Apple ID password randomly. Now restart your phone and re-enable these services by following the steps above. Temporarily switching iMessage and FaceTime off might work.