In my case, it was a problem with the gpu driver. I relied on the one automatically installed by windows and didn't bother installing the official one myself. Turns out, there was a conflict once newer windows updates were installed, and randomly caused my pc to freezeright after logging into the desktop.
I just manually installed the latest driver for my gpu, which I got from the manufacturer website, and never had the issue again. I had no clue this could be a gpu related problem, but it really was.