What do you do if you have a negative coworker?
For the most part, I recommend you stay away from negative coworkers. There really is no upside to you spending time with someone like that.
But, if this person is a friend or someone you are willing to help out, then step in and let them know they are damaging their reputation and career.
Keep in mind, any negative culture or environment you spend time in will eventually affect you.
Usually, the problem doesn't have much to do with work. They have something going on in their life that makes them the way they are.
Personally, I enjoy these conversations. It gives me a chance to help someone by having a candid conversation other people may not be willing to have with them.
If you do feel like you can help, sit down with the coworker and be candid. Explain how other people see their attitude and how it affects them. Offer to help. Oftentimes, people who are so negative don't know what is happening. They don't know people are avoiding them because of their attitude.