The S/PDIF jacks on your TV & external audio devices could be labelled S/PDIF, Digital Audio, Optical Audio, TOSLINK or Digital Coaxial. They are all the same digital audio format which is S/PDIF = Sony/Philips Digital Interconnect Format.
In general, you would connect from an RCA jack to an RCA jack using a Digital Coaxial Cable or from an Optical port to an Optical port using an Optical/TOSLINK cable.
What should I do if I have a mismatch of S/PDIF ports?
TV has Optical OUT but HTS has Digital Coaxial IN:
Use an Optical to Digital Coaxial converter