If a student is accusing you of harassing him or her, it is a serious allegation, it can fall under Title IX potentially or under the school's sexual misconduct policy or under the school's say general code of conduct. Whatever policy the school would be using, again, it is a serious allegation. In terms of defending against such an allegation, if the student is alleging that this was done by say text message or social media, of course, if there's evidence that speaks otherwise, that would need to be presented to the school at the given time.
If the harassment word is alleged to have been done in a different manner, in terms of say, strictly being verbal, if there's any, say potential witnesses, or perhaps the accused student would not even have the opportunity to do as the accusing student is alleging. Preparing the necessary defense and response is, of course, critically important. You have to take the necessary precautions. You shouldn't engage with the school until you do so. Having an experienced attorney advisor will help you best understand and navigate the process and will help you take those best steps forward when responding to a case that involves an allegation of harassment.