Apple has released a supplemental security update for Mac OS X El Capitan (the predecessor to macOS Sierra. According to Apple, it “fixes a kernel issue that may cause your Mac to occasionally become unresponsive.”
The update originally was released in December 2016, but has been reissued. You can obtain the update by launching the Mac App Store app, then checking for updates.