Be honest and straight forward:
First thing you need to do is to register your disapproval. If you feel someone around is negative then do not hesitate in telling that person. It does not mean that you will just bombard harsh words and tell them to leave you. Try to say it politely and make them realise that you are telling them just because the realisation of the problem is always the first step towards a solution.
Give them ultimatum:
You should give them a chance to make themselves better personalities. It is always better to say that you won’t be able to continue supporting them if they won’t eradicate the negativity in them. This will not only save you from their wickedness but also motivate them to drain out all the negativity.
If you are in a situation like in the office or some study group, where you are bound to have those people around you, then do not confront. Confining yourself in a limited circle is another effective way to get rid of such people. Just ignore them and stay focused on your work. If you have nothing else to do then keep yourself busy in listening music or watching movies etc.
The most important thing you must know is that it’s all about controlling your thoughts. You must realise that because someone else is negative does not mean that you have to be. Notice the positivity around you and divert your thoughts to good things.
Look for the root cause:
You should try to understand their nature and psyche. Perhaps, they are going through some emotional distress so lend a hand and help them to come out of this trouble.
If they continue then stop being nice and simply walk away.