In case your iPhone has become buggy and is not functioning properly, you can reset your iPhone and restore it back using an iCloud Backup. This might be your only option, if it is getting difficult to identify and troubleshoot problems on your iPhone.
Restore iPhone Using iCloud Backup
Restoring iPhone using an iCloud Backup works only on a brand new iPhone (with blank data) or on an iPhone that has been Reset to its Factory Default Settings.
Hence, the first step would be to Erase all the data on your iPhone (Steps 1 to 4), followed by the remaining steps to restore your iPhone using an iCloud Backup.
1. From the Home Screen of your iPhone, tap on Settings > General
2. Next, tap on Reset
3. On the Reset Screen, tap on Erase All Content and Settings.
4. You will see a pop-up, tap on Erase iPhone to confirm that you do want to Erase All Content and Settings from your iPhone.
5. Once you tap on Erase iPhone, you will see a welcome screen (Hello) asking you to Set Up your iPhone (See image below)
6. Follow the onscreen instructions to Set up your iPhone, until you reach the Apps & Data screen (See image below).
7. On the Apps & Data Screen, tap on Restore From iCloud Backup (See image above).
8. You will be prompted to Sign-in to your iCloud Account. Enter you Apple ID, password and tap on Next (See image below).
9. On the next screen, tap on the iCloud Backup that you want to Restore your iPhone from (See image below).
Your iPhone will begin the process of downloading the selected backup files from iCloud Drive and your iPhone will be Restored with all the Settings and data as available in the backup file.
Consider Using iTunes Backup
Although, an iCloud Backup is automated and super convenient to set up, it does not include all the data on your iPhone. An iCloud Backup includes the most essential data on your iPhone as explained in this article: Difference Between iTunes and iCloud Backup
Hence, you should always consider making a complete backup of iPhone or iPad to your local Computer using iTunes.
This will ensure that all the data on your iPhone, including all Apps, Music, Books, call history, Photos and Videos is available as a backup copy, in case you end up losing data on your iPhone.