This has happened to me a number of times before I finally found the setting to stop it -- Settings --> Restart Options --> Show more notifications (set this to ON) -- and I have, since then, received several notifications from Microsoft saying they were going to update my laptop, giving me time to save all my work and restart it manually when it was convenient for me. So far, I have not had this setting turned off when Microsoft has done an update, though others here say that has happened to them, so always check this setting after an update.
HOWEVER,
my laptop still shuts down spontaneously. This is a different shutdown/restart than those that Microsoft initiates, as there is no associated update. The laptop just suddenly shuts off, then restarts. I looked into this on the web and apparently this is a know issue but no one seems to know why it is happening. So, Microsoft shutdowns solved, but my laptop still manages to lose my work about once or twice a week.
This won't help many people, but what I've done to mitigate this is to switch from MS Word to Scrivener (this is not a commercial). I bought the Scrivener software years ago and fiddled with it but never got the hang of it. I only resorted to it because of this problem. Scrivener saves your work as you type, so if the laptop shuts off in mid-sentence, you can just open Scrivener back up and your work is all still there.
This, naturally, doesn't help with Excel spreadsheets, databases, Photoshop or anything else, but since I'm a writer, the bulk of my work can be done in Scrivener and I just have to remember to keep hitting SAVE when I'm working in anything else.