Swaying occurs when your body moves laterally towards the back foot on your backswing rather than coiling around a central axis. Most often, swaying causes the weight to shift to the outside of the back foot (the right foot for all right-handed golfers) on the backswing.
Many people will try to correct a sway by preventing their weight from shifting at all. Keeping the weight towards the front foot (the left foot for all right-handed golfers) prevents a full hip turn and unnecessarily restricts the backswing.
To prevent swaying, make sure ample pressure is maintained on the inside portion of the back foot, which will help you coil your body around the central axis as you swing the club back. An excellent drill to feel the pressure on the inside portion or instep of the back foot is to place a doorstop under the outside portion of the back foot. As you swing the club back, the doorstop will force your weight to stay to the inside.