Bariatric surgery, also known as weight loss surgery, is used as a last resort to treat people who are dangerously obese (having a body mass index of 40 or above or 35 plus other obesity-related health conditions).