Windows update won't work on Windows 8.1

This happened to me before. I get the error something something windows update failed. Last time this happened, I had to delete some update log and some directory. I don't remember what I did. Does anyone know how to fix this situation? Thanks in advance.
 
Yes. I do sign in with my Windows account.

I found the solution over the weekend, though.

After combing the internet for solutions I found Windows 8 or 8.1 rather doesn't like 3rd-party virus protection and firewall products. I saw references to McAffee and Norton and how removing them did the trick. So I disabled and uninstalled my Avast Internet Security, the update took hold immediately. I guess I'll just run Windows Defender and Windows Firewall on my Windows 8.1 machine as these are supposed to offer all the protection I need (HA!).

Why isn't the EU suing MS over this!? Gahhhh!!!!

I'm sure there's more than one way to skin a cat, though. Did you have another solution? I do like using Avast.