MacBook Pro won’t connect to the Internet
There can be many reasons for this and I am not aware of any single silver-bullet.  You'll need to try several things to chip away at the issue until you resolve it.

You can boot a mac into safe-mode to test (how you get there depends on the version of macOS).  

See:  https://support.apple.com/en-us/HT201262

You can also create a new (temporary) user account, then log into that account to see if it has the same issues as your primary account.  If it does not have the same issues, then it usually indicates that something in your account may be causing the problem.  This could be a corrupt .plist file.  It could be something that starts up at login (System Preferences -> User &amp; Groups -> (select your user) -> Login Items.  It could also be something that launches via launchctl (check the contents of ~/Library/LaunchDaemons).

You may need to do a bit of network sleuthing ... do you get an IP address (and what is it).  Home routers will generally issue an IP address in one of the RFC-1918 blocks (see: https://tools.ietf.org/html/rfc1918).  These typically begin with 192.168.x.x or 10.x.x.x but could include 172.16.x.x through 172.31.x.x (although I have never seen a home router use that 172 range).   

If the address begins with 169.254.x.x then this is a self-assigned IP (meaning the DHCP server did not issue an address.)

From here (assuming you have a valid IP address) you would want to check the value of /etc/resolv.conf (which lists the DNS servers your mac will try to use to resolve servers) and also check your default router using the command (in Terminal) netstat -rf inet (look for the row that begins "default").  (netstat -rf inet will only look for IPv4 addresses.  IPv6 is excluded.)

Make sure you can ping the IP address of the default router.