Although it is common for people who make statements like that to actually be saying that someone in their own life has disappointed them, but instead of dealing with the personal issue they confront the disappointment as being an aspect of all of humanity. It is a way of intellectualizing emotions that are harder to confront personally. Debating in that scenario is counterproductive. Discrediting the view of humanity is equivalent to saying the person who hurt them was not wrong. This motivation (often subconscious) can apply to just about any personality type. It is easy for people to slip into. In that case I would let them work out the problem mostly on their own, perhaps remind them of some people we knew who actually seem pretty good, and/or demonstrate that people can also be helpful.
It can also be the person was taught this mindset. There are various religions for which this is the basic premise. In that case it might not be that personal and a well thought-out argument might do some convincing.
Edit: I have had a few significantly negative friends. In real life application I don't tend to think there is much one does to change it. In those experiences I mostly listened and pointed out logical fallacies when the rant ended because that was discussing it on the terms of their natural strength. A few times I got firm about the line of thinking being irrational and could get a good response. To have a lasting effect would require a level of input I'm not capable of. The issue is that in those cases there is a cause-and-effect at work. I have noticed especially for natural problem-solvers, they can be deeply scarred psychologically if as a child they were confronted with problems outside their scope to solve (typically in the form of abuse). It creates a deep cynicism that might be impossible to break through. It is a kind of psychological imprinting that is made of granite.