Depends on the TV and specific soundbar in question.
Soundbars generally have Toslink and/or HDMIx2
If your TV + Soundbard support Toslink, just connect them.
If there's no Toslink, run HDMI to the Soundbard via the HDMI "In" and "Out" to the TV. HDMI-Soundbard-TV.
Without HDMI support on the TV (at least), things get much more complicated...... and realistically, it's likely more economical to just replace the TV.