Windows 10: Windows Update Error or Loop

Download and install the Windows Update Troubleshooter from Microsoft that will fix your Windows Update issues:

If that fails, you can always delete the downloaded files and start over.

(From Microsoft):

Whenever Windows updates website scans and install any updates or patches, it gets stored on the below location.

Depending upon the updates different folders gets created on the above location.

For clearing the contents of the softwaredistribution folder, try the below commands on the command prompt.

net stop wuauserv
rmdir %windir%\softwaredistribution  /s /q
net start wuauserv