No one can help unless you post what the error messages are. What restore screen is it stuck on?
Restore: Connect your iPhone to iTunes on your computer, backup, and then select Restore to Factory. Also, see Restore your iPhone, iPad, or iPod to factory settings and If you forgot the passcode for your iPhone, iPad, or iPod touch, or your device is disabled - Apple.
For help with the above on later models, including iPhone 7, 7s, 8 or later, iPad Pro 11" and iPad Pro 12.9" models, please refer to If your iPhone, iPad, or iPod touch won't turn on or is frozen.
If all else fails then make an appointment at the Apple Genius Bar for service. If you need to find an Apple Store - Find a Store - Apple. If you did not purchase it from Apple then you will need to look to the vendor for service or How to find your nearest Apple Authorized Service Provider (AASP) or Distributor (AAD).