Is your "soundbar" 5.1? Does it have separate surround speakers?
If so then check that you TV will output in 5.1 surround (usually called bitstream). This will be an option in the TV audio menu.
If it does then connect the BD player to the TV with HDMI. Connect the soundbar to the TV optical output. You may have to turn the optical output on and turn the TV speakers off. Check the TV manual on how to use the optical output.
Select the optical input on the soundbar. You will now get surround sound on anything that plays on the TV if it is surround encoded. If not then select a surround mode on the soundbar for a 2 channel source.
If the TV won't output in 5.1 then you will need an HDMI audio extractor or input selector to provide a...