Online stalking and harassment happens when one person keeps contacting someone who does not want to be contacted.
If someone tries to talk to you online and you do not want them to, you can block them so that they cannot contact you.
If someone does not want to talk to you online they can block you so you cannot contact them anymore.
If someone blocks you or asks you not to contact them anymore you need to respect this and leave them alone.
If someone is bothering you online, speak to someone you trust or contact the police.