You say this keeps happening. Go and talk to your doctor. Maybe there is something wrong with your thyroid. Or some other imbalance with hormones/chemistry in your body. Or something with the mind. I’m not a doctor but i’d say it’s worth checking if it’s some physical problem. And if it’s some mental problem, it also helps getting help (or at least a diagnosis) sooner than later.