It should work automatically, once a mini Toslink is plugged in. Do you see the other end of the cable light up at all, I mean just by looking at it?
One note regarding 5.1 sound: It will only output previously-encoded 5.1 sound from media you play, e.g. DVDs and some online content. Your Mac cannot encode 5.1 for the optical digital output on the fly. I believe it
can send uncompressed stereo (2.0) over the optical digital output.
Maybe this older thread can help?
https://forums.macrumors.com/thread...utput-5-1-surround-sound-please-help.1412975/