If you need to reset your iPhone to factory settings to resolve an issue, you can back it up to iCloud first and then restore it to keep your data.
If you forgot the passcode to your iPad, or the device has been disabled, you can restore and unlock it with a computer or the Find My Website or app.