To fix it, all you basically need to do is press a button on your keyboard and it’ll get the task done. Otherwise, other apps and platforms including YouTube won’t be able to play any sound. You want to make sure your system is allowed to play sounds from any source.
Although this is most obvious fix when there’s no sound on YouTube, some users have their system sound turned off which causes the no sound on YouTube issue on your computer.