Go step by step and test.
1. System Preference > Sound > Output > Internal Speakers
Highlight Internal Speakers.
Make sure that Mute is not enabled.
2. Plug in and remove the headphone.
If you see red light in the headphone port, plug the headphone
in and out of the port 5 or 6 times to flip the microswitch inside.
Sound output may be stuck in digital mode.
3. Reset PRAM. http://support.apple.com/kb/PH18761
4. Reset SMC. Choose the appropriate method.
https://support.apple.com/en-us/HT201295
5. Try starting up in Safe Mode. https://support.apple.com/en-us/HT201262
Once in Safe Mode, click the “Restart” button at the bottom.
5. Applications > Utilities > Audio MIDI Setup
Audio Devices window
Side Bar
Click the Built-in Output.
Make sure that box is not checked under “Mute”.
Make sure that Format is set at 44100.0 Hz.
Right click on the Built-in Output for available options.