The headphone jack on my MacBook Pro just stopped working. How do I fix it?
I've had similar issues and restarting coreaudio work for me. Run this in a terminal (you might be prompted for your password).

sudo pkill coreaudiod


If your curious sudo is something used to run commands as administrator (SU-DO as in super user do) and pkill sends signals to processes based on name, in this case coreaudiod, which is the name of the coreaudio daemon process. When it gets a terminate signal sent by pkill it will terminate and then macOS will restart it again.