You're kind've like a rat.
That's not meant to be an insult, because I'm kind've like a rat too. This is true for me especially, but humanity in general has a lot of rat-like qualities when it comes to thinking. We like to think that as humans, we are totally in control of our facilities at all times -- free will and all that -- and that we can't be tricked or controlled without our knowing. You are much better off accepting that this is not true as soon as possible, and instead of fighting against it. Work with your stupid rat brain instead of thinking you're better than a rodent.
But what do I mean by rat brain? Well, you've seen that stereotypical laboratory on TV where they have beakers full of bubbling green liquid and a rat maze just hanging out. In it, the rat might get taught to avoid a red platform because every time he steps on it, he gets zapped, and taught to go for a green platform, because every time he steps on it, he gets a piece of cheese.
This is called conditioning and you are not immune to it. In fact, I can guarantee that all of your teachers up until now -- yes, even your university professors -- are doing this shit to you. You get a gold star every time you do something good in class or get an A on the test or whatever. You get punished every time you do something bad like be noisy in class or watch porn on your laptop during lectures. You and I are already conditioned human beings, so there's no point in denying it.
A lot of people -- and especially myself at a younger age -- don't realize that we also condition ourselves. We reward or punish ourselves, but usually in more subtle ways. I know that I still justify games of League of Legends to myself by saying that I studied hard all week, and I deserve these 45 minutes of killing cartoon characters dammit. It can even be less concrete than this, though. Have you ever felt bad after doing something shitty? That's negative conditioning: Your bad mood helps condition you to stop doing dumb shit in the future.
With this type of "bad mood conditioning" you may have noticed that this depends on whether or not you actually feel bad about something or whether you want to feel bad about it. I'm sure you're already well aware that people don't like feeling bad, so they will avoid it as often as possible. If you ever wondered how somebody can be an absolute dick and not be remorseful about it in the slightest, it's because remorse is a shitty feeling and they're actively trying to avoid.
Ok, so what can we do this knowledge? Well, let's say you get stressed out at work or in class or with your friends. Somebody says something to you and it pisses you off, or you put off an assignment until the last minute and it stresses you out. Afterwards, you go out and have a few too many beers, or you complain to someone, or you hit something or someone, or you eat too much. This is called "catharsis" and Freud was one of many who suggested that it works to "cleanse" the mind and prepare you for further challenges. Despite being the only psychologist you can name, Freud was not always right.
Go back to the rats. In the multiple scenarios above, ask yourself what the "cheese" was. It was, of course, the booze, the food, the fighting and the complaining. All of the shit feels good, and you're going to "step on the green platform" to get it. The problem is that stepping on that green platform is the bad mood that you started off in. If you condition yourself in this way (stress --> something good) then what do you think your little rat brain is going to try and do? That's right, your rat-ass self is going to seek out that stress.
What's funny is that this is hard to counteract. Even when you're aware of it, you can't help but go, "Ugh, today sucked. I deserve pizza." But again, this only makes you fatter and angrier. This is actually why it's so hard to lose weight actually. People try to positively condition themselves by working out and then rewarding themselves with cake, or they misunderstand negative conditioning and try to soothe themselves with food when they're too tired to exercise.
You can counteract it though. Number one, you should always be thinking about Future Salvador. You have a tendency (we all do) to push all of your problems onto that asshole, but that asshole is actually you. He will have to deal with the problems that you create for him, so don't forget about him.
Also, start rewarding your accomplishments. If you want to do that with booze or food or whatever, go for it. If you accomplish everything you set out to accomplish in a day, give yourself a beer or a cookie. I'm almost 30 years and every day that I feel like I worked hard the entire time, I give myself a gold star sticker. Right there on my calendar.
If you can, punish your failures. You can beat yourself up every time you fail, which contrary to what people tell you when you're in a bad mood, is a good deterrent and will help you from doing it again. Nobody else will be as hard on you as you are on yourself, so go nuts. Also, do not seek comfort from your failures in other people. If you get into the habit of saying to your friends or girlfriend, "Ugh, my day sucked. Let me tell you about and you can give me compliments to make me feel better," you're going to be having shitty days more often. Finally, try and shoot for the opposite of whatever kind of reward you were giving yourself before. I have a tendency to feed myself when I'm in a bad mood, so I'm trying to do the opposite more often. When I'm in a shitty mood, I will eat a big bowl of shredded cabbage. It's good for me, and it doesn't reinforce my awful behavior.
You get the idea, rat-boy. Go out and make it happen.
Your Useless Mentor,