Hi.
It's actually pretty common for people to become "obsessed" with their teachers, whether or not they consider it a romantic crush. Sometimes it comes out of respect and admiration for an older, accomplished person--perhaps someone who is especially kind to the student or even just smart or good-looking.
It sounds like you're a little angry at yourself for feeling this way. And that's understandable: You probably know that pursuing a relationship with a teacher is a really bad idea. It's not just that it's illegal (if you're a minor and he's not); if you did get involved, his position would give him power over you that probably isn't healthy.
But there's really nothing wrong with having feelings about somebody. As long as you're able to keep some distance from the idea of acting on them, the feelings themselves are not the problem.
If thinking about your teacher is seriously distracting you, however, there are a couple of things you can try. One idea is to indulge your obsession--find out even more about him, allow yourself your private thoughts--and see if, once it's not forbidden anymore, it becomes less interesting. Or maybe there's a way to bore yourself without going through all that: Does he maybe remind you of somebody you don't like?
At some point you're probably going to realize that your teacher is just another guy! Or maybe you can be friends.