Start with this...
Safe Boot, (holding Shift key down at startup), does the problem occur in Safe Mode? Could take 10 minutes or more.
Safe mode attempts to repair Disks & clears lots of caches & loads safe Drivers, & prevents loading of 3rd party extensions, so if Safe Mode works try again in regular boot.
Make a New Location, Using network locations in Mac OS X ...
System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
The interface that connects to the Internet should be dragged to the top of the list.
Sys Prefs>Network>highlight the Interface you're using>Advanced>TCP/IP>Configure IPv4: Using DHCP.
If using Wifi, instead of joining your Network from the list, click the WiFi icon at the top, and click join other network. Fill in everything as needed.
System Preferences>Network>choose interface>Advanced>Proxies Tab, make sure none are set, like for HTTP & HTTPS.
System Preferences>Network, unlock the lock if need be, highlight the Interface you use to connect to Internet, click on the advanced button, click on the DNS tab, click on the little plus icon, then add these numbers...
8.8.8.8
8.8.4.4
1.1.1.1
9.9.9.9
Apply.