The poster is not specifically adddressing our age-group of people, or any age-group.
That said, the operative words are, "if you feel save doing so"
It depends on the situation, whether there are others people present than only the person being harrassed and the one harrassing, and on whether you have any training in coping with this kind of thing.
Phoning the police is, or should be, an option.
I read recently of a young woman cycling through a park a little before 8 a.m. She saw a couple struggling behind a bush, and as the girl was kicking and lashing out while a man was trying to remove her jeans, it hardly looked like consentual sex.
It wasn't, and by calling out, "Shall I phone the police" she prevented a rape. The man ran off, but as both women could describe him, he was later apprehended and charged with attempted rape - so yes, react if you safely can, or simply go round the corner before phone 999!