Do you have specific model numbers?
Generally speaking, your options will be Toslink or HDMI.
Toslink will connect from the TV to Soundbar, with all Audio fed to the TV, being passed to the soundbar.
Typically, HDMI options will go to the soundbar first, then on to the TV - with only the audio from the HDMI connected device's (cable box etc) going to the TV*.
*Ie you could change your input to , say a games console, but the audio would still be coming from your cable box.