Question so simple yet so complex. I think mood is a state of mind, you can feel however you like, but external factors do have an influence on how you feel.
Are there any good ways to not fall into this bad mood, to remove the negative feelings, fears, doubts, ifs...
There are things like gratitude, meditation, deep breathing, etc but I don't think these exercies alone will keep you happy for a long time.
We do have some degree of control over our moods, but it's not unlimited. It's limited by our ability to reframe our experiences in positive ways.
The basic practice is to "look on the bright side"; ie. make an active effort to find the good in whatever we happen to be experiencing. Example: "You didn't succeed, but at least you tried." Instead of focusing on the fact that you failed, which might lead you to think of yourself as a failure and lead to a negative mood, you focus on the fact that you tried, which might lead you to think of yourself as someone who at least makes an effort. Both are facts: you did fail, but you did try, so focusing on either half of the equation isn't delusional, but focusing on the latter half of the equation is healthier because it leads to a better opinion of yourself and to a better mood. This is what positive thinking is all about; always choosing to look for the real, positive implications of your experiences, because there are always positive implications, and if we miss them, we're missing out on real reasons to be happier than we are. (It is NOT about trying to convince yourself of things that are not true. If you're bad at math, you don't try to convince yourself that you're good at math.)
A similar practice is to compare your experience to the experience of others: "This experience is bad, but at least it's not that experience." This can lead to a feeling of gratitude.
Also related is challenging the idea that you know how things will turn out ahead of time. A lot of people assume they know whether or not any given effort will succeed (they assume everything they try will fail) and this leads to passivity, which means their problems never get solved. Since no one can actually predict the future, it's best to adopt a "let's try it and see" approach to problems. Keeping in mind that you might
succeed at an important task, even if it seems probable that you won't, can help level out your mood.
Your ability to look on the bright side is limited by your metaphysical beliefs; eg. if you believe that when you die you cease to exist, you can't take comfort in the thought that when you die you'll go to heaven. Believing in heaven can improve your mood if you happen to be terminally ill or someone you care about dies. I suspect this is why religion continues to be (and will continue to be) a powerful force. Because when things get bad (really, really bad) you have to go beyond what you're currently experiencing in order to find ways to positively reframe your experience. So another way to improve your mood is to change your metaphysical beliefs, which people do all the time through a process called conversion. There are plenty of existing religions, but people are more apt these days to turn to "New Age" styles of thinking; believing in things like the Law of Attraction, etc. If you believe in the LOA, no matter how bad things are, you can always turn them around by 'raising your vibration'. (I present this as evidence; I'm not endorsing anything.)
Another technique is through changing your focus. Our moods depend to a large degree on where we place our attention. We can either sit around dwelling on our problems, or we can find ways to distract ourselves (watching TV, playing games, etc.). In this regard, it's probably better to watch a comedy than a horror movie. Distraction can be useful in the short term, and for certain kinds of problems of a temporary nature (like having a cold) but doesn't tend to help that much in the long term because it doesn't change the conditions that are generating our bad mood (it doesn't make us any healthier, richer, etc.). I think most of the benefit of mindfulness is based on this change of focus (although it also reduces overactivity in the brain). It's developing a habit of paying attention to your surroundings, your breath, etc., instead of paying attention to the things that are stressing you out.
Another technique is exercise, which is not only distracting (as above) but also releases endorphins, which make you feel good. (Diet and getting more sleep are other things you might consider, since being healthy tends to make us feel better than being sick.)
A lot of our negative moods are rooted in unnecessarily negative self-concepts, so fixing your self-esteem can be really important as well. (But that goes well beyond this post.)
Good moods can be cultivated, but it requires a fair bit of effort if you have a habit of being negative. I can often be very negative, because my circumstances are very negative, but considering the seriousness of my problems, I'm pretty upbeat. I should be much more negative than I am. But I haven't always been this way. I have actively cultivated different habits to improve my mood.