It's a common issue. You can follow below steps to fix it.
Before trying to fix the iTunes error with some methods, you need to be sure you have the newest version of iTunes on the computer. Sometimes just updating to the newest version of iTunes is enough to resolve all syncing problems, particularly if the desktop software hasn't been updated in a while. You can always download the newest version of iTunes
directly from Apple. After updating to the newest version of iTunes, if you find that your iPhone still won't sync with iTunes, you can follow the tips below to fix the error.
1. You can simply quit out of iTunes, then relaunch the app, and try syncing again. Sometimes this is enough to get your iTunes working again.
2. If syncing fails, the Sync button is greyed out and not available at all, or if you try to sync and nothing transfers over to the iPhone, iPod, or iPad, you may simply need to authorize the computer with iTunes.
3. You can also try restarting your phone by holding down the home button and power button.
4. Sometimes just restarting a Mac or PC is enough to resolve the problem and get things syncing again.
5. Typically use Wi-Fi Syncing? Try using a USB cable instead. Usually use a USB cable? Try using Wi-Fi syncing instead to see if that works.
6. If you find wireless sync to suddenly stop working, you typically just have to toggle the feature on and off again to get it functioning again.
7. Sometimes USB ports go bad, and though it's pretty rare it's very easy to rule out. All you need to do is switch the USB cable from one port to another and see if it works.
8. Reset and restore the iPhone. This should be your last option. You will lose all the data on your device. You will be resetting your phone to factory settings and start as if its a new phone. Only advantage is that you have iCloud backup.
For more details, check: How to Fix When iPhone Won't Connect with iTunes