Handling Negativity

How do you maintain a high enough level of consciousness when someone throws a ball of negativity at you, so that you don’t feel resentment and anger afterward?