Macbook Pro won't connect to internet via Wi-Fi or ethernet
The first thing I would try is removing your Wi-Fi service, restarting your MBP, and then adding your Wi-Fi service back.

Follow these steps:


Go to Apple > System Preferences > Network
Select the Wi-Fi service on the left-hand side
Click on the cog icon at bottom-left and select Make Service Inactive
Now delete the service by clicking on the minus sign (i.e. the - button) at left of the cog
Click on the Apply button
Exit Network preferences
Restart your MBP
Go to Apple > System Preferences > Network
Click on the plus sign (i.e. the + button) at left of the cog
In the pop-up window, ensure that Wi-Fi is selected from the drop-down menu
Click on the Create button
Make sure Wi-Fi is on and connected (it should remember your previous settings, but if not just re-add your Wi-Fi network again)


If this doesn't work you can test to see what happens in Safe Mode.

Boot into Safe Mode 


Fully shut down your MBP 
Restart your MBP
Immediately press the Shift key and keep it down 
Let go of the Shift key when you see the login window (NOTE: If you 
have FileVault enabled you may need to log in twice). 
Test to see what happens (i.e. try connecting to Wi-Fi)
Exit Safe Mode by restarting your MBP as normal 
Test again to see what happens


Note: Booting into Safe Mode will take longer than usual.

If you're still having problems during Safe Mode, then try testing your hardware.

Run Apple Hardware Test

Your model MBP uses Apple Hardware Test. To use this, follow these steps:


Shut down your MacBook Pro 
Restart your MacBook Pro
Press and hold the D key before the gray startup screen appears.
After a while, Apple Hardware Test (AHT) will start.
When prompted, select your language and click the right arrow. 
When the AHT console appears, you can choose to run Basic tests by clicking the Test button. However, I suggest you select the "Perform extended testing" checkbox before you click the Test button.
Your test results will appear in the window in the bottom-right of the console.


Note 1: The extended test will take some time. Take a note of the results and report back. 

Note 2: If pressing and holding the D key at Step 3 doesn't work, start again at Step 1 and, at Step 3 press and hold both the OptionD keys instead. This will try and run diagnostics from the internet instead, so you will need to allow more time for it to complete.

Run these Terminal commands

Let's confirm what macOS believes the status of your Wi-Fi service is. To do this:


Launch Terminal (usually found in Applications > Utilities)
Enter the following command:

sudo networksetup -listallnetworkservices
Press Enter
Enter your password (note you will not see the cursor move, nor the characters appear on the screen)


Now, in the list that appears I assume you will see an asterisk (*) next to the Wi-Fi service. This denotes that it is currently disabled. Assuming this is what happens, let's try enabling it as follows:


Make sure you're still in Terminal
Enter the following command:

networksetup -setnetworkserviceenabled Wi-Fi on
A popup will prompt you for your password - enter it and click on the Modify Configuration button 
Now enter this command:

networksetup -setairportpower en0 on
Restart your Mac
Now check System Preferences > Network again


Let me know how you go.