To be honest, I have never really found an effective way to be around negative people that does not eventually lead me down the path of negativity. If someone else has a way, I am all ears.
I suppose it is largely because I spent most of my life dwelling in the negative. As a youngster, I was perpetually scared, and maintained that narrative through my early adulthood. Fear is now a daily battle, far more than any other temptation, because it is the mother of all temptations.
Living in fear wears one down and takes away joy. Being scared means not being happy. So, the battle to overcome fear is the struggle to be happy.
So, when I encounter a negative person, I find myself contending with two negative people: me and the other person. And, like in a street fight against two muggers, I have to fight twice as hard. I have two people rolling out negative and depressing narratives that must be recognized and overcome.
I look for those criticisms and complaints that tap into old resentments only recently buried (or perhaps denied). many are only made in passing, as part of the wind-up for a bigger grievance. Sometimes, I have to kill all the small ones first before I can touch the big one, otherwise I end up tacitly agreeing with them and then fighting the big one becomes virtually impossible.
Of course, once emotions start to come out, the party is over. Emotions are rationality-killers by design: we have emotions to stop the contemplation process. Emotions drive us to action, and once the action process begins, it takes a while to suck back up all those brain chemicals that get flowing during the emotion process.
That's why I have to work on my emotional health when I'm not having emotions... which is usually the times that I forget about my emotions. Growing up is a slow process.
In the end, I have to give these negative people to God, because I can't handle them. I can help them if they are willing to let go of negativity, but if they are not, then I just have to keep the doses really short.
If I am powerless over myself, then I am powerless over others. That's it, really. The biggest 'bad influence' on me is me. Only God can save me from myself. I have no way to 'fix' other people except to point hem to God and tell them where there solution lies.