Makes and model numbers would be useful.
Make sure you have the optical input selected on the soundbar.
On some TVs the optical out is always active. On others you have to turn it on and sometimes turn the TV internal speakers off.
Sometimes you have to change the TV audio output type to be compatible with the soundbar,