The "It's almost time to restart" message appears when Windows finishes installing critical updates that require a system reboot to complete.
This prompt can appear in different forms depending on the Windows version or how the update was scheduled, including variations such as:
Despite the differences, they all mean the same thing: Windows requires a restart to finalize the installation of critical updates, including security patches and driver updates, which need system-level access not available during normal use.
Postponing the restart may cause Windows to force a reboot later or continue showing the message until the update completes.
Windows can't finalize the installation of critical updates while your system is active, so it schedules a restart automatically.
Author's summary: Stop Windows restart prompts.