This used to happen in my teens and as a kid and back then just remain silent.
Even as a adult today not sure what is correct response, either IRL or online.
Think if you have nothing nice to say, just say nothing.
Online block or ignore person.
As one who has live longer than most around here, I have some insight to these things.
First, let me say that I've learned that everybody you come into contact with, whether irl or online, wants something from you. EVERYBODY.
This includes your friends, family, parents, employer, cashier at the grocery store, etc.
Parents want love and respect (and maybe for you to take care of them when they're old).
Children want food, shelter, love, and guidance.
Spouses want love, companionship, and intimacy.
Your boss wants an honest days work.
The cashier wants a smooth transaction and maybe a "Hello" or "Good morning" from you. You get the picture.
The hard part is not only for you to discern what people want from you but to also decide if you will give it to them and what you want in return.
Under most circumstances, these exchanges happen naturally. You don't really have to think about it. But sometimes, it's harder to figure out.
In the case of internet trolls, they just want a reaction/response from you. I feel it gives them a sense of power to know they've provoked you into engaging with them. So the question is: are you willing to give them what they want AND are you getting something in return?
Don't let people who have no business in your life, needle their way into your life. Our time on this Earth is limited. It's a precious gift that can be taken away at any time. Don't waste it on stupid people.
*The air up here on this soapbox is really thin! I'm getting a little woozy! I'd better get down now.*