Without model numbers we can't check what connections you have.
There are two kinds of optical audio plugs but home gear only uses the one that is kind of square. Portable gear uses one that is round. You can get an adapter to change one to the other. Or just tape the plug in place. Since it's optical the connector just holds the toslink cable in place and doesn't affect the transmission of light.
If the soundbar doesn't have a digital input and the TV doesn't have analog audio output you will need an optical to analog converter.