Moods ups and downs can be due to, for a over simplification, the "main" male and female hormones changing levels in your body: testosterone and estrogen. I'd have to look up the articles, but simply put: the more testosterone you have, the peppier and full of energy you feel. When it lowers naturally and adjusts monthly is when you can see a big uptick in things from energy drive to do things, sex, appetite, and mood (happy vs depressed). Men and women experience the level change, but women can experience it more dramatically just before their menstrual cycle: they'll have a higher testosterone level, then as their cycle itself happens, the level will drop again, and the estrogen level will surge up causing the moodiness and depression.
Other chemicals in our bodies can affect mood and energy levels without effecting behaviors. For a long time growing up I'd take the pill "SAM-E" which would even out the moods for me in a gentle manner.
Another thing that can adjust moods is the stress hormone.. or chemical. Science did a huge magazine on it years ago, primarily outlining that the stress hormone even in small doses in your body consistently for years is more detrimental than getting bursts of it sporadically throughout your life- like it adjusting blood pressure, susceptibility to illness(s) and heart issues.
Another that comes to mind off the top of my head is vitamins and deficiencies. ie if you eat more meat during your menstrual cycle, you'll feel better because you'll be getting iron back into your system. Another is consumption of water; just making a point to drink at least 12oz a day vs none or dehydrating drinks (like coffee) can improve your mood since your body uses water in everything. Same thing with finding a multivitamin that works for you - but don't marry it - as you age, it's not a bad idea to switch up your vitamin intakes every few months.
All vitamin stuff should be done under studying and looking at things - I was just looking a multivitamin vs another to get stuff for my hair/skin/nails and both have large amounts of Vitamin A. A bit of reading later, and taking both together will put me at 70:100 range of "starts to be dangerous intake levels but not deadly".... So yeah, read up on things before you just take them willy-nilly. On the plus side, most of the time your body will shoot out the excess vitamins in urine and BM's, assuming you have healthy kidney's and so forth, and a fair amount of water.
Oh and one more thing of advice would be getting consistent sleep hours. If you sleep 6hrs 3 nights a week, 7 another 2, and 10hrs for the last 2 nights, you're doing your circadian rhythm a disservice. Aim for the same amount every night.