Hi, there! Which cable does the soundbar use? HDMI and digital optical cable?
If you provide the make and model of both your television and your soundbar then we can provide you with a better answer.
Some soundbars don't support optical. Some don't support HDMI. If your soundbar supports both, then you will need to see what your television supports. Once again, some support HDMI for audio (ARC/eARC) others do not. Most have a optical audio output, but not all do.
So, it's hard to give a actual specific answer on such a vague question. But, the previous answer does kind of hit the main concept.