You can help your friend by:
1) Reporting it on the medium they got bullied. For example, if he was a victim on facebook, then to the facebook community.
2) Take advise from your elders. I.e students, teachers etc.
3) Report the crime to your nearest cyber police centre  in your district.
And for future measure make sure to have firewalls, anti-virus systems and strong passwords.