Most TVs have an optical digital audio output. Most soundbars have an optical digital audio input.
If the soundbar has an aux input you can use the headphone output if the TV has one. If not then you would need an optical to analog converter.
Next time post your question in the correct sub forum and supply makes and model numbers so we can give you an exact answer.