I've heard this used in various contexts, but there is one that I am confused about which relates to being emotionally vulnerable. Specifically, it seems like people say that about situations where they might face being emotionally vulnerable and are afraid to standup for themselves or simply express their own feelings, even if other people are not acting maliciously toward them.
I thought 保护好（你）自己 is more likely to be used when talking to someone going into a dangerous situation, maybe a rescuer entering collapsed buildings after an earthquake.
But I did find:
As a woman, you've gotta learn to protect yourself, especially with regard to your emotional well-being.
If someone says 'protect yourself',
generally this remark is aimed at women or disadvantaged groups.
Saying this to a man,
smacks of jesting.
Thus this phrase may be a joke. (when directed at a man.)
Men! No emotions! :)
This sentence implies that the receiver is perceived to be in adverse circumstances, or going to face uncertainties or challenges. The occasions to say it include, but are not limited to, the following:
Relatives comforting a child who has lost his/her parents to an accident.
Father/mother giving advice to the child on the first day attending a new school.
Father/mother saying farewell to enlisted son.
Kung-fu masters say to each other before carrying out assignments.