This is pretty normal... We see the world & ourselves through how we feel... At your age you can expect a lot of ups & downs in how you feel. It's difficult to remember it's all not REAL but just chemicals in our brains.
Pay attention to the things you do and the things you eat. Look for patterns. Maybe the days before you feel negative, you are doing or eating something in particular. What are you doing before the good days? I know it often works like that for me, but I didn't see it for years because I didn't have a regular life routine so the ups & downs just seemed 'natural' and part of ME... when really a lot of the time it was because I ate some real junk the night before...
Either way, sometimes we just feel bad, & our brain starts thinking of bad things to go along with the feelings. You don't have to believe it, though.
[Warbing to the fellas: this reply contans some mild girl talk ]
Remember that we ladies will have this happen more often to us simply because of our hormones. I can usually track my ups and downs along with my cycle. And, even though I fully understand that this can happen, it can still catch me off guard. When this happens, do a quick mental check: "Have I been on my game, have I been slacking, and where am I in my cycle?" Then, you can tell if it's just your mind (or your hormones) playing a trick on you.