Avoid Such People Whenever Possible
It may be true that you work with such a negative person or live in the same neighborhood or usually see each other at a commonplace, your interactions with such individuals can be controlled. For example, you can do most of your communications with such a person through non-physical means such as mails or text messages.
You should also pay attention to their sitting location or behaviour patterns during breaks, meetings, lunchtime etc, and avoid them when necessary. During meetings, you can choose not sit near them enough to force a conversation. If the two of you are both working on the same project together, you can decide to limit the amount of time spent in the same room. In General, keep your interactions with such toxic people to an absolute minimum .