Connect everything to the TV.
Samsung TV Inputs:
Blu-Ray to TV by HDMI
Cable/Satellite to TV by HDMI
Other to TV by HDMI
Samsung TV Output:
TV Optical to Soundbar
This way all you have to do is change the source on your TV and it will automatically send the audio digitally to the soundbar.
Other steps to take. If you remote supports it. Configure it to turn on and off your soundbar and TV at the same time. Configure the remote control volume to only control the volume on the soundbar. That way you aren't accidentally turning the TV speakers up and down. Then turn off the speakers on the TV.
If sound doesn't work be sure to select the optical as the source on the soundbar. Check your TV's manual or menu to see if the optical...