Try not to worry...when you have an obsession, it doesn't mean that you are really going to do that thing...actually, usually obseessions are about things that you would never do. But I understand that it's stressful however

If you often have anxiety at school, could you talk about it to a psychologist? Maybe it could help also with that obsessive thought, if it's related to anxiety.