When your Mac says it is connected to Wi-Fi, it means you have linked to your local router, but the router itself cannot reach the broader internet.
Quick Fixes to Try
- Restart your router and modem: Unplug your router and modem from power, wait 10 to 30 seconds, and plug them back in.
- Restart your Mac: Go to the Apple menu () > Restart to clear out temporary network glitches.
- Forget and reconnect to the network:
- Open System Settings > Wi-Fi.
- Click Details (or the info/three-dots button) next to your network.
- Select Forget This Network and confirm.
- Reconnect by selecting your network and re-entering the Wi-Fi password.
- Turn off your VPN or security software: If you use a VPN or third-party firewall, temporarily disable it to see if it is blocking your traffic.
- Check your date and time: Go to System Settings > General > Date & Time and make sure Set date and time automatically is turned on (incorrect time can break secure web connections).
- Go to System Settings > Wi-Fi > Details next to your network, then click DNS.
- Click the + button and add public DNS servers like 8.8.8.8 and 8.8.4.4 (Google DNS), then click OK
- Create new Network Location
- Open System Settings
- Click on Network
- Click the ••• / down caret at the bottom of the preference pane
- Select Locations > Edit locations.
- Click the (+) button, give the location a name (you can delete it or rename it later), and see if that corrects the issue.
- More info: Use network locations on Mac - Apple Support

For detailed official troubleshooting steps, check the Apple Support Guide on Mac Wi-Fi Issues.