My first thought is for your friend to buy a new SIM for their phone service provider network, and then log in to the phone service account and swap his phone number to the new SIM.
But... if the hacker has access to your friend's contacts, that makes it sound like the hacker is already in your friend's phone service account and has likely changed the password, in which case I'd still buy a new SIM, and then call the phone company to do the activation "manually".