Sound not working when running OS 10 Yosemite
By default, without an external monitor and no headphones plugged into the MacBook Pro, the audio should come out of the built-in speakers and you should be able to control the audio with the built-in keyboard volume controls. If you hold down the ⌥ Option key while clicking on the audio icon in your statusbar, you should see this:



If, however, you have an external monitor plugged in via Mini DisplayPort or HDMI, and your monitor supports audio passthrough, then you may be running into a problem of the MacBook Pro seeing that monitor as the primary audio output device.

If your goal is to play audio through the built-in speakers, simply select Internal Speakers in the drop-down shown above and you will be able to control the volume again. It should look like this screenshot:



If your goal is to play audio through the external speakers, and your volume controls do not work, then that means your external speakers (or monitor's speakers) do not support the volume controls in your MacBook Pro, and you will need to control the audio through your speakers or monitor. There should be an audio control on the speakers, or you may have been provided a remote to use with the monitor/speakers.