If you don’t have any sound on your Mac, this can be due to a number of issues. Here are the things you need to check, in the order you should try them.
1. Make sure your volume is turned up.
2. Check speaker power or headphone connections.
3. Turn Bluetooth speakers on and off if you use them.
If that doesn’t fix the issue, hold Option and click on the speaker in the dock. From here make sure that you choose the right source for your sound. In many cases it should be line out.
You can also click on Sound Preferences to see other options, which may help you find a problem. If all else fails you may need to restart and it unplug and reconnect headphones or speakers.