You must take action after you've been accused of harassment at work or else you could lose your job and professional reputation. Both federal and state laws forbid employee harassment and place legal responsibility on employers for ensuring a hostility-free workplace. Since employers would open themselves up to legal liability if they didn't handle harassment claims, formal complaints are taken very seriously.
Listen to what the person accusing has to say about your behavior and remain serious if he approaches you about it. Acting as if the situation is funny or trying to get back at him in any way could escalate the matter into a more serious problem because the accuser may feel disrespected. Let the accuser speak his mind before you respond.
What you should do next depends on your view of the circumstances. Apologizing is appropriate if you feel your behavior was wrong, but an apology might function as an admission of guilt later. Don't apologize if you don't feel you did anything wrong after listening to the accuser. Instead, you may thank the person for saying something. In both cases, you should state the behavior will not continue. You don't need to go to your supervisor or HR department if talking to the accuser resolves the issue. Your boss or HR representative might have to start a formal investigation if you report the exchange.
Talk you supervisor and HR department immediately if the accuser files a formal complaint against you. Ask how the investigation will proceed and what is needed from you each step of the way. You must cooperate fully whether the charges are false or true. Lack of cooperation will reflect badly on you in the course of the investigation. Don't confess to or take responsibility for anything you didn't do and keep the investigation confidential to protect all the parties involved. If you're part of a union or other labor organization, contact your representative before you say anything to investigators, as they'll protect your interests.
Get Legal Help
You might need to hire outside legal help if your accuser files a lawsuit against you or you feel the investigation is biased. You can lose your job if you're found guilty of harassment, depending on your employer's policies and the nature of the incident, so you have to act if you feel the investigators aren't doing their jobs properly. You will have to pay legal expenses out of pocket but you might be able to recoup some of the money in court if you're found innocent.