No idea as to why it happened but regarding "Also, how could I fix it myself if it happens again?".
You could make a recovery disk. The below link tells you step by step on how to do this.
It beggars belief that PC's can be sold without Windows OS disks or Recovery disks, IMO it just makes the job of getting your computer up and running again all the more difficult, as you have sadly found out Skinn.