You have celiac disease.

Celiac disease—an autoimmune disorder in which ingesting gluten causes damage to the small intestine—can lead to a drop in weight, and tends to be accompanied by other GI symptoms like bloating and diarrhea, says Jamile Wakim-Fleming, M.D., a gastroenterologist at Cleveland Clinic.
If you have celiac disease and eat gluten, your immune system can go a little out of whack. This reaction can mess with the lining of your small intestine, hampering its ability to help you absorb nutrients properly, according to the Mayo Clinic.
Treatment: According to the Celiac Disease Foundation, the only treatment for celiac disease at the moment is to adhere to a strict gluten-free diet.
You’re struggling with depression.
Dr. Ali notes that stress and depression can make weight fluctuate to some extent. Loss of appetite is a common side effect of clinical depression and one that can promote unexplained weight loss if you’re unaware that your mood swings are something a bit more serious. “In a lot of cases, the person doesn’t even notice they’re losing weight because they’re mired in the depression,” Dr. Cappola explains. Irritability, heavy drinking, indecision, and problems sleeping are other common symptoms of depression.
Treatment: Talk to your medical provider to find out your treatment options. Many doctors will prescribe antidepressants and talk therapy.