The very first thing to do is to take a good multi-vitamin every day. I know this advice sounds trite and gee-whizzy, but nutritional balance is essential to emotional balance. Get exercise and sunlight and take a D3 supplement. And get a good night's sleep. These aren't the only factors, but can be "the straw that broke the camal's bacl". The mood changes are hormonal and they are the result of powerful polypeptides (signaling substances) being released into the bloodstream. It is interesting that these "mood swings" probably have survival value, or they wouldn't have persisted over the millions of years men and women have been around. Cheer up. Life is full of nice stuff.
Magnesium is the calming vitamin. Make sure there is some in the multi you are taking.