Your iPhone encountered an error -54 when you try to sync the deivce with iTunes, the alert message says:
“The iPhone [device name] cannot be synced. An unknown error occurred (-54).”
For this error -54, Apple gives an explanation on their official support page.
This can happen if a file on your computer or iOS device is locked. In most cases, your sync will continue if you click OK at the bottom of the message.
If your content doesn’t sync, restart your computer and your iOS device. Also, make sure that you have the latest version of iTunes and the latest software updates for your device.
If the above method can not fix the issue, you should continue to follow Apple’s solution