I've seen this issue around before, and I've also had it. But those times, it was usually an error of having a vpn or being offline or a malaware installed preventing me accessing the launcher.
However, after going through my host file, I realize that it is blocked (as attached)
I tried fixing it by deleting it and saving, but it says I don't have permissions. I'm a little confused, as I am administrator on my computer so that shouldn't be a problem.
This has been going on for a while, I've deleted, restarted minecraft, restarted my computer, tried editing the host file, tried disconnecting wifi, reinstalling java etc.