There might be numerous reasons for sound not working on MacBook. Annoying as it is, there are also a number of solutions you can try to fix it.
If you can't record audio on a Mac using macOS Mojave or later - Apple Support
MacBook sound not working? Here are 10 fixes to try
No Sound in MacBook Pro? (7 Reasons Why and Fixes)
MacBook sound not working? Here are 10 fixes to try
MacBook Has No Sound? Get Not Working Sound Back Easily
MacBook sound not working? Here are 10 fixes to try
How to Troubleshoot Audio Related Issues
How to Fix Sound Problems on Your Computer
What To Do With Mac Sound Not Working – Setapp
9 Ways to Fix It When Laptop Speakers Are Not Working
HP PCs - No sound from speakers