Not “retaliating” makes you strong.
It is weak to react. It is weak to not have self-control. It is weak to attack. Don’t use this knowledge to attack an attacker, by the way.
People attack others because they feel powerless. Self-control is powerful and it feels powerful.
Being aware of your thoughts, feelings, and needs and advocating for them non-violently is the most effective way to take care of yourself. A response might be a vulnerable share, or leaving the room/building (after giving a reassuring verbal notice), or even visiting a layer or calling 911.