Restarting can fix a stuck session without fixing the fault that made it stick. Use it as a controlled reset, then repeat the task that failed. A desktop appearing again is not the same as the problem being gone.
Software keeps working state: open documents, running tasks, connections and information held in memory. Ending a process and starting it again replaces much of that running state. Saved files and settings are a different matter. If a bad file or setting caused the failure, it can cause the same failure after the restart.
Restart the smallest thing that fits
If one application is frozen but everything else works, start with that application. Save anything you can, quit normally, then reopen it. Closing a window is not always quitting the application, so use its Quit or Exit command where available.
Apple’s troubleshooting guidance recommends reopening an unresponsive app, restarting the Mac, trying another file and checking compatibility or updates. It also warns that force quitting can lose unsaved changes. Force quit is a fallback for an app that will not close, not a better version of Save.
If several applications are misbehaving, or quitting the affected app changes nothing, save work across the device and use the operating system’s Restart command. Avoid interrupting an update that says it is still installing. If the whole device is unresponsive, follow its maker’s forced-restart instructions rather than improvising button combinations.
Off and on is not always the same operation
Windows has a useful wrinkle. With Fast Startup enabled, shutting down can save the kernel session and drivers to disk for the next startup. Microsoft says Restart bypasses that Fast Startup path and performs a full boot cycle. For this troubleshooting step, choose Restart rather than assuming Shut down followed by power-on is equivalent.
This does not mean you should disable Fast Startup or edit the registry. Those are separate changes for specific problems. Nor does a restart mean a factory reset. Keep options that erase content or reset all settings out of an ordinary restart experiment.
A restart with a useful result
Hypothetical example: A document editor freezes whenever it opens one file. Another application still responds. Before restarting anything, note the file and the operation that fails. Save other work, quit the editor and reopen it with a different, non-sensitive document.
If that document works but the original still freezes, the file is now a stronger suspect. If every file fails, restart the device once and repeat the same comparison. Do not also reinstall the editor, delete its settings and clear unrelated browser data. Changing four things together gives you four guesses about what helped.
If reopening works only briefly, record what happens before the next failure: opening that file, using a particular feature or leaving the app running. Take that reproducible sequence to the app’s support instructions, along with the software version and exact error text. Leave document contents out of a public support request.
Repeat the original task and reopen its saved output to check whether the restart helped. If it fails again, the restart bought time rather than a repair. One restart is diagnosis. Five restarts is a hobby.
