Apple decided to eliminate the optical output on new iMacs. Not sure about other Macs at this point.
So my other post about using a toslink cable to connect to a preamp or processor is no longer correct - if you have an iMac from around 2015 or later. I haven't confirmed what the exact date of that is, so if this is a consideration for you make sure you check it out before buying.
I am in the process of researching other options, there are devices that connect to a USB port and will output to a toslink port, but I'm not done getting that figured out. If your pre/pro has a USB input then you may be good to go.
Hopefully there's an easy solution, but it has to be able to output at minimum a 24/96 audio file. If it doesn't do that then forget about using a new Mac as a music server.
At the moment you're better off getting an old iMac, MacBook or Mac Mini and using that for the easiest, built in solution.
Currently I'm using an older 13" MacBook Pro. I am going to start using an external SSD drive as my music storage so my internal drive can be used just for OS. When the internal drive dies I won't have to worry about losing my music collection. This machine is dedicated as a music server anymore.