Open: Control Panel-Network and Internet-Internet Options-Advanced-Restore Advanced Settings-Apply-Reset -Reset - Close, if it is Windows 11 system, there is no reset button, directly click OK.
At the same time, open to the Internet Options, you can first point: Connections - LAN settings, see if the automatic detection settings are not checked, check on the proxy server if there is a check uncheck and then point OK.
Locate: C:\WINDOWS\system32\drivers\etc
Find the hosts file cut to the desktop (that is, clear the host of the operation), and then see how the effect.
Have had this issue for a couple weeks on Bedrock edition for Windows, but I finally fixed it. Found the method through a Microsoft support page: https://answers.microsoft.com/en-us/xbox/forum/all/i-cant-sign-into-minecraft-bedrock-edition-because/ad3a2325-6ada-434f-a5f8-db6977c16ea9
Did the following:
Open: Control Panel-Network and Internet-Internet Options-Advanced-Restore Advanced Settings-Apply-Reset -Reset - Close, if it is Windows 11 system, there is no reset button, directly click OK.
At the same time, open to the Internet Options, you can first point: Connections - LAN settings, see if the automatic detection settings are not checked, check on the proxy server if there is a check uncheck and then point OK.
Locate:
C:\WINDOWS\system32\drivers\etc
Find the hosts file cut to the desktop (that is, clear the host of the operation), and then see how the effect.