The best way to deal with negative coworkers is to limit your contact with them.
Negative people can bring down your own mood and productivity, so it's important to surround yourself with positive influences.
While it's not always possible to avoid negative coworkers entirely, minimizing your interaction with them can help you stay happy and productive at work.
Okay, so typically, when you have very negative coworkers or people you're working for or with, the best way is to avoid that person. I'm used to dealing with people that are often negative, and no matter what you do, they're never going to be positive.
Typically, you will rise to the level of the people you're with. You want to do your best to be around people. If you're around negative people, that will rub off on you. I have a kind of personal philosophy this may not apply to you. But when I'm dealing with people, there are certain types of people that I deal with that I can't avoid.
I will limit my contact with them, and just not productive for you to try to engage with those sorts of people. And it's just, unfortunately, that's the way it is.