How can I know if losing hair caused by losing weight or stress or genetics?

Alopecia. of the many causes, some are nutritional. At your age, it is much less likely to be genetic. Do you know how to eat healthy? Iron deficiency anemia is a cause. Time for a checkup with your PCP, and possibly a dermatology consult.