Optimism and a positive attitude promote good health. Research shows that the optimistic persons have healthier immune system. Pessimistic expectations breed negative experiences. No matter how bad things might appear, you can see a silver lining. There is someone who has worse problems.
Misery loves companions.
Reach out to such people. This will help both parties. Make a conscious effort towards finding good things. As far as possible stay away from pessimistic people. Don't get drawn into other people's misery.