First we should try to make the friend that he falling into bad company and it would spoil his life.If the friend understands it well and good.If he doesn't the only way is to take the matter to elder.That is we should tell the friend's parents about the problem.
2 3 2
1)We should explain him patiently that spending more time with the bad company would affect his studies and may spoil his life.

2)If he doesn't ask we should meet the new friend and tell my friend to spend time in studies.

3)If he still doesn't ask the final choice is to take the problem to the elders.That is parents.