I've got my headphones connected, and I've checked system preferences to make sure they are the audio output device. Most sound comes out through the headphones, like Spotify and YouTube. But, system sounds come out through my thunderbolt display, like dragging a file to the trash.
Seems to only be a problem since I upgraded to Yosemite.
Best Answer
Under "Sound Effects" tab, change "Play sound effects through:"
Instead of automatically changing this option, when I plug in headphones this setting remains unchanged.