One of the most important sources of pessimism in anyone's life is negative people. You may tell someone your goal, and either by their face or tone of voice or what they say, you're left with the feeling that your dreams are pipe dreams and you're never going to make it. Or they just put you in a bad mood because they talk about negative things (or talk about positive things from a pessimistic or cynical viewpoint).
All people who bring you down are not created equal. They can be distinguished by their intentions.
One kind of person who brings you down, and probably the kind you've run into most, only brings you down because they themselves are down (because their thoughts are habitually pessimistic). They don't really intend to bring you down. It brings you down to be around them only because emotions are contagious. The first thing to try with these people is to convince them to give up their pessimistic ways. Learn the material in Undemoralize Yourself very well, and then teach it to them. If they don't want to hear it, the next best thing you can do is talk to them very little, and when you do, be vague. Read more about that here.
Another kind of person who brings you down is an emotional manipulator. They try to control you by changing your emotions in whatever way will help them accomplish their purposes. If it helps them to make you happy, they'll make you happy. If it helps them to make you feel guilty, they'll do that. Here's a good article on that. The best thing you can do with these people is learn to recognize it, and avoid them completely (or if you can't avoid them, talk to them very little and be vague).
Another person who might bring you down is someone who is jealous of your success or talent and doesn't want you to succeed. As soon as you recognize this one, their negativity won't take the wind out of your sails anymore. Somehow the negative feeling is balanced out because jealousy is a kind of compliment. And you will sometimes feel compassion for them.
And another kind of person, luckily a very small percentage of people, are sociopaths. Only about one to four percent of the population are sociopaths (meaning they don't have normal feelings of empathy for others). The only way to win with them is to get them out of your life completely, even if they are family members. Read more about that here.
In the quest to rid yourself of unnecessary negative emotions, in your ongoing quest to feel lots of healthy, positive emotions, this is an important topic. People who bring you down are the most significant source of negative feelings and pessimistic beliefs you have. You might have more input from media sources, but personal relationships have more influence.
You may not have someone in your life right now who brings you down. I hope you don't. But if you do, take it seriously. Try to figure out what their intentions are, and decide how to deal with them. Do not let them continue to bring you down. Their influence can make you more pessimistic over time.
So take care of it and then concentrate your time and attention on the relationships that bring you up.