DIAGNOSIS This is almost always a ground loop or electrical interference, not a faulty speaker. It's introduced through the audio cable connection.
FIX If using the optical cable, this noise is impossible as it's a digital light signal. The hum comes from the HDMI-ARC or 3.5mm aux connection. Unplug all audio cables except power. If the hum stops, you've confirmed the source. Plug the audio cable back in, but disconnect it from the TV end. If the hum returns, the cable is picking up interference.
IF THAT DIDN'T WORK Try a different, shielded HDMI cable. Plug the soundbar and TV into the same wall outlet or power strip to ensure a common ground. Move power cords away from audio cables.
HEADS UP Do not use a 3-to-2 prong 'ground lift' adapter on the soundbar's power plug as a fix. That can create a shock hazard. Use an optical cable instead to break the electrical loop safely.