Generally for a sound bar you use the TOSLINK (digital optical cable) from TV (output) to the TOSLINK (digital in) on the sound bar. This way any input your tv is on will always work with the sound bar.
Find a post useful, please click on "Like" to give the author recognition or mark as an accepted solution.
You'll need to provide details about how you've connected your soundbar. There are at least 4 different ways it could be connected depending on the model. 1) Toslink (optical) 2) Digital coax 3) HDMI ARC 4) RCA analog