Once you lost iPhone passcode and want to reset it, you can follow the following steps:
Step 1: Connect iPhone to computer via a USB cable> launch iTunes on computer.
Step 2: When you launch iTunes, it will automatically sync your device. But if it doesn't, you need to do it on your own, which means you have to do the following steps: Click "View"> "Show Sidebar", then your iPhone will be displayed in the left sidebar.
Step 3: When iTunes have synced and backed up your device, please go to "Device" in the sidebar. Then click on Summary tab. Next go to "Restore iPhone" button.
Step 4: Finally, click on "Restore Backup" to restore iPhone from iTunes backup files and then you can reset your iPhone passcode.
If you have backed up data to iTunes previously, you can use FonePaw iPhone Data Recovery to extract data and save them to your computer.