There are only two ways to get digital audio between your TV and soundbar, or your TV and receiver, or really between any piece of gear that transmits audio in a home A/V system: HDMI and optical.
While wireless audio is likely our future, cables will almost certainly remain part of our audio and home cinema set-ups for years to come. So it pays to know a thing or two about the different types ...