Hmm... probably not doing it would help.
As for being the receiving end.
Being assertive, stern and outspoken about behaviors you are a subject to.
Old saying which I just invented.
"Take no shit. Get less shit."
And, probably, not to advocate for burka because that's a retarded overkill, but if we dress and behave appropriately, that might invite less attention.
Standing out is a friend of all forms of harassment, across all cultures, colors, and sex.
The best way I believe is to fight back.
Sexual harassment happens when someone sees you as someone who is weak. But if you show them that you are not weak then if they have evil plan to you, then they will think twice.