Optical audio from TV to soundbar. Check the TV manual on how to turn on the optical output.
For external sources you can connect them to the soundbar with HDMI and then the HDMI out of the soundbar to the TV. This will give you better sound for sources like blueray discs that support Dolby TrueHD.