I recently had some pretty annoying problems with my 2016 MacBook Pro Touchbar where it refused to play any sound or recognize my headphones including the microphone. The “Sound” preferences didn’t even recognize any audio interface anymore.
After a good two hours on Google and trying a bunch of things out, it turned out that one has to reset the SMC (System Management Controller) on your Mac to fix this.
Hope this helps some poor souls running into the same issues.