If it's happening on a specific site or social platform, involve the admins of that site/platform. Especially if it is being done anonymously, they may have access to information you don't have about this unknown person, and they may be able to save that evidence and document it in case it later escalates to the point where police involvement would happen.
If it's merely annoying behavior, you might not be able to do more than just ignore it. Don't reply at all, not even to refute insults.
If it's at a higher level, such as stalking or threats of any kind of harm, certainly involve the police.