Without model numbers we can only guess what audio outputs your TV has and what audio inputs the soundbar has.
On many TVs you have to turn on and configure the audio output to get it working.
If the TV and soundbar don't have compatible connections an active converter is often needed, There are different ones.