Can losing a lot of weight make your hair fall out?

I recently lost 30 pounds in two months due to a stomach problem I’ve been having (I’m on a restricted diet and it’s caused me to lose weight rapidly) but I’ve noticed a lot of my hair is falling out. Like one shower can clog the drain cause I lose so much. All I eat are veggies, fruit, and meat so it’s not unhealthy foods, could this be causing the hair loss?

I’m only 18 and I am freaking out. Thanks in advance