Loose motions may be due to viral infection, bacterial infection, due to any medical condition, or allergy to food or any vegetables, anxiety problems. So, First you should maintain proper dietary management.
Rehydrate. Water replaces fluid but not electrolytes lost through diarrhea. Electrolytes are minerals that help your body manage its fluid levels, muscle activity, and other important functions. Go for soup and broth with sodium, fruit drinks or a rehydration fluid such as Ceralyte, Oralyte, or Pedialyte.
Eat bland, safe foods. When you have diarrhea, stick with soup and broth. When you feel ready, add lean meat, yogurt, fruits, vegetables, and complex carbohydrates such as rice, potatoes, and bread.
Avoid food triggers. To put an end to diarrhea, steer clear of foods and drinks containing caffeine and lots of sugar, as well as sugar substitutes and fried or fatty foods. Also take a break from high-fiber foods, spicy foods, dairy products, and foods known to cause gas, such as beans, broccoli, and cabbage.
Wash your hands. When you have diarrhea, wash even more often than normal, especially after going to the bathroom and before eating.