You could do a few diagnostics and tests and tell us what you see.
Assuming Windows 10 Home:
Ethernet or Wifi.
A listing of ipconfig /all when it fails.
what sort of machine is it
Which browser?
When it fails can you ping the site you want to get to.
If you right click on the network icon on the task bar does the screen show connectivity? Is the network set to Private.
and even checking if the adapter is enabled and showing connected.
If you are using IE or Edge, try using Chrome and see if it connects.
If you are using Norton or McAfee turn it off and use Defender.