Theres pretty much nothing you might do; you just have to wait.
This can be frustrating and, sadly, there is no silver bullet to this issue.
But there are some things you might try.
Why Does This warning pop-up Appear?
This generally happens when there are apps running in the background that needs to be properly shut down.
It is advised that you close all running apps before shutting down or logging off.
Some Windows prefs can also cause this error to occur.
As such, try each of the following methods until one of them works.
The first thing to do is to launch the System File Checker on Windows.
However, its advised that you execute the DISM tool first.
Disable Fast Startup
Even though it has its advantages, there are manyreasons to disable Windows Fast Startup.
One of these is that it can interfere with how Windows shuts down.
So,turn off Fast Startup on Windowsand check whether this solves the problem.
Tweak Your Sign-In Options
Additionally, you canblock Microsoft sign-ins on Windows 10altogether.
Use the Task Manager to end any problem tasks.
PressCTRL + Shift + Escand end the process before you turn off your PC.
To help you find the offending program, you canuse the Windows Event Viewer.
Otherwise, check for any updates for the service or re-install it.
If the problem persists, thetask host may be preventing Windows from shutting down.
Resetting things to the way they were before the error started showing up may help solve the problem.
Mostly, however, it is likely just third-party apps causing the trouble.