Identify the toxic behavior from the other person affecting you. It's making you feel bad. Knowing toxic behaviors gives you solution to handle the issue.
Stay away from toxic people. This means that you are telling them how their behaviour is to you and that you can no longer tolerate it.
Talk to toxic people as little as possible. Limit contact, this means talk less, keep movement very limited.
Share your problem with a family member or someone you can trust. This will reduce your stress.
Never change your behavior because of toxic people, live openly and experience new things. Being happy is the only way to deal with this problem.
Never blame yourself, it is not your fault the other person is toxic. No matter how wrong the behavior of the other person is, understand one thing, you don't have to change it.
To reduce your mental stress and to get the right guidance, read good motivational and psychological books.
Breaks are crucial when working on long or complex tasks. Stand up and take a walk, or clear your head.