Although sound bars are often pictured on the wall below a wall-mounted TV, many of them are shallow enough to fit on a TV stand in front of a television. If you plan on going this route, double check the sound bar's depth to make sure it will sit safely on your TV stand.
If you do plan to wall-mount your sound bar, think about cable management. You'll need to run at least a signal cable, plus a power cable if the sound bar is amplified. If you don't intend to run your cables through the wall, you can just let them hang down, or use a cable-hiding raceway to cover them. But if you do want to hide the wires in the wall, here are some important things to consider:
Try to avoid mounting your sound bar on an exterior wall, since these walls have extra bracing and insulation that can make running wire difficult.
Follow local building and fire codes. In many cases, this means you'll need to get UL-rated A/V cable labeled CL2 or CL3. The Underwriters Laboratory (UL) looks at heat generated from current flowing through wire, how quickly the cable will catch and spread fire when exposed to flame, and the wire's susceptibility to damage from external stresses.
Don't run the power cable inside the wall. If you want the power cable hidden, you'll need to hire a licensed electrician to install a recessed AC receptacle in the wall, in a location where it will be covered by your sound bar or TV, and not obstructed by the sound bar's mounting bracket. You and your electrician may also want to consider in-wall power protection units. Another option is to route the A/V cable in-wall, and use a small wire raceway on the outside of your wall for the power cord.