It's best not to watch romantic movies or TV series during that time, and don't remind yourself that you want to fall in love.
Usually, you should study more and read more books, try to divert your attention, and don't focus on the teacher. If you are really free, go out to play with your roommate.
I couldn't help myself, so I found a good friend to enlighten me. Now that I know it is not correct, I can only restrain myself and come out after a while.