Most soundars have an ARC HDMI input and an optical input, some also have stereo RCA.
If your TV supports ARC you will need to figure out which HDMI input that's for and connect that to the soundbar and then enable it in the TV menu.
If you have a coaxial SPDIF output it can be converted to optical.
For my cheapo Veon TV I had to turn on HDMI (CEC) to then be able to turn on HDMI (ARC)