1. First we will need to discuss the problem with our friend, either he is not interested in studies or not.
2. Help him or her to make studies more interesting by motivation and games etc.
3. To tell him or her about the side effects of bad companies, like he or she will is ruining her future on her own.
4. Discuss with his or her parents about the problems he or she is facing and about the guidance and mental support she or he needs. etc.
Hope it helps you!!!!