This usually occurs when there is an update file is preventing your PC from updating.
The tough part here is that that a Clean Boot cannot be attempted to troubleshoot the issue since the system cannot be restarted unless we force shut down it.
Task Host Window, Task Host is stopping background tasks
If Task Host Window is preventing shut down, then these suggestions will help you fix the problem.
1] Try Windows Update Troubleshooter
If it fixes the issue, well and good, else proceed to the next step.
2] Restart InstallService Service
3] Change Sign-in option
Open Settings > Accounts. Now go to ‘Sign-In Options’ and scroll down to find ‘Use my sign-in info to automatically finish setting up my device after an update or restart’ under ‘Privacy’. Turn off this feature and see if it that works for you.
4] Turn Off Hybrid Shutdown/Fast Startup
While the Hybrid Shutdown/Fast Startup is used to speed up Windows, it might cause the issue mentioned here. Try the following steps to turn off Hybrid Shutdown/Fast Startup:
5] Reduce shutdown time
Should all the solutions mentioned above fail, you could do the following: Press Win + R to open the Run window and type the command regedit. Press Enter to open the registry editor. Navigate to the path: Right-click WaitToKillServiceTimeout in the right pane and change the value to 5000. Now navigate to: Again, right-click WaitToKillServiceTimeout in the right pane and change the value to 5000. Setting this to a lower four-digit value, (say 5000) will make your PC shutdown faster, but you could end up losing data or cause possible disk corruption, so use this tweak judiciously. Remember, Windows does not, in any case, recognize a 3-digit numeral here. The steps mentioned above should help resolve your issue.