TRY speaking with him personally and give him warnings like this is bad and u will soon be spoiled whenever he sees u say that u are sad 
tell him for a better future u must study and not be in a bad company 
Try to explain him how bad this will be for him . Speak calmly. Try to take him away from that . Also, try to spend more time with him .This way , u will be sure that he is not going to them . Try to focus more on studies . Make him enjoy  being with you .This applies to girls also .