They say that the best way to control a bad habit is through early realization. Once you realize that it is wrong for you, you immediately take actions to keep a check on it. Similarly, the sooner you realize that the guy you like is bad for you, the better it is. This will prevent you from falling in love with him, or from developing a sense of attachment towards him. If you have a crush on the guy who is being a bad influence, follow the follow points:
When you finally realize that you have a crush on someone, ask yourself if that the guy is right for you. Is he a good influence? Does he treat you properly? Is he into illegal stuff like drugs? His attitude with other people explains a lot about him. The way he handles his juniors and seniors at work will speak volumes. His reputation in his neighbourhood is another indicator. Once you know that he is not the right one, accept it and make peace with it. This will help you in getting over him. Do not debate with the thought over and over again, or you will have trouble accepting it.