Hi and Welcome. My Name is ***** ***** I look forward to assisting you today with your question.
There are several reasons for this problem. What is the error code you are getting ?
Are you sure ? Can you do the restore again and tell me the exact errors ?
This time connect it to differnet USB port and do the restore in DFU
I will send you some instructions now here. Please stay online
Thanks for your patience. Error 22 is a system error, which is either related to that specific computer only or with the iPhone itself. The error you had received means that iTunes is unable to restore (which means it was unable to install the firmware/iOS software) on it and something interrupted the process. This also happens if there is any issue with the USB. So I want you to do these steps.
So first I want you to restore it from different computer using different USB cable. This will rule out the computer. Restoring from different computer fixes 90% of the issues.
If you don't have another computer, then uninstall iTunes and all Apple components completely from your computer and then reinstall iTunes. Refer this article --> https://support.apple.com/en-us/HT204275
Please let me know if that didn't work, so we can continue troubleshooting
Also if DFU Restore fails, then do a Recovery restore. To put it to Recovery mode, connect it to your computer and press and hold down both Home and Power button until it shows USB cable pointing to iTunes icon. Then restore from iTunes. Unlike DFU Mode the iPhone will not be blank in recovery mode. Timing is not important to put it to Recovery mode. Just hold down both buttons while connected to computer until it shows iTunes and USB cable screen.
Note : iTunes says recovery mode both in DFU or Recovery mode.
Error 21 is a serious hardware issue which means the hardware component of your iPhone is what causing the problem. This is not a software issue. In some cases this will happens if there is any issue with battery or sensor. I will send you the instructions that you can attempt to fix it, ASAP
In some cases connection issues between the USB port and battery can cause this problem. Remove the battery from your iPhone. Wait 2 minutes and then put it back. Make sure there is no dirt or dust inside the phone. Then attempt to restore it. Refer this article --> https://www.ifixit.com/Guide/iPhone+4+Battery+Replacement/3141
Error 21 is an hardware issue, refer this article --> https://support.apple.com/en-in/HT204770
If you have not tried already, then attempt to restore it from different computer. If it doesn't work, then remove the battery, clean the dusts or dirt inside the phone carefully. Make sure you remove the battery sensor cable carefully.
Try to restore it after taking out the battery and putting it back. I've an article where the users have the similar issue --> https://www.ifixit.com/Answers/View/81953/Why+wont+my+phone+restore,+keep+getting+Error+21
If it doesn't work, then you may need to replace the battery. You can get the battery from eBay or Amazon for like $5
Not need to uninstall and reinstall iTunes. But it is OK. After reinstalling, attempt to restore it.
It is ok. Let it complete. :)