Sway bars in real life
Sway bars are used to mitigate body roll in cars. An explanation of how they work in the real world can be found in the video linked below. It also gives some useful information about the limits of their effect.
Video credit goes to: Matthew Eddy on YouTube.
Sway bars can also be known as Anti Roll Bars
Sway bars in BeamNG
Creating a sway bar
In BeamNG a Sway Bar can be implemented by creating a single node above the wheels in the centre of the vehicle, then add a beam connecting it to each wheel and two beams connecting it to the chassis.
In the image that is linked below you can see how this is implemented in the Ibishu Covet.
Modifying a sway bar
You can adjust how effective you want the sway bar to be based upon the spring values of the beams connecting the pivot to the wheels. By lowering the spring value you allow each wheel more independent movement. By making it stiffer you make the vehicle sway less, this comes at the sacrifice of ride quality.