Understanding the problem is the first step in moving forward. Don’t feel bad about having a crush; crushes are something that everyone experiences at some point of view and the human brain is actually biologically programmed to fall in love. Getting over a relationship is hard, even if that relationship never fully materialized. Give yourself some time to mope around and feel badly, then pick yourself up and move forward. Make sure you're not upset for too long. While feeling sad, also take steps to comfort yourself. Try taking a hot shower, listening to one of your favorite playlists and speaking nicely to yourself. Knowing that this relationship will never progress is an important step in moving past it. Remind yourself again and again that what you’re doing is necessary for your own personal happiness and growth.  Remember that you will have other crushes. In many people's minds, having a crush on your teacher veers towards the inappropriate sector, no matter how you feel. It is against the law to be with someone over 18 if you are under 18. There will be others who you will prefer in the future, and others who you have a real chance with. Focus ahead, without dwelling too much on this dynamic with your teacher.
Admit that you have a crush on someone. Allow yourself to feel sad. Commit to moving on.