what can we do, to avoid being a victim.
We can't do anything else then getting proper awareness related to such scams. I have also heard a similar story sometime ago and the scammers used same kind of AI voice cloning tools to scam many people by mimicking the voice of their loved ones. Sometimes we really can't decide that what to do in such situations and we become helpless because the scammers create a scenario that we can't ignore at any cost.
Like in your friend's case he had no option but to send money to his friend because his friend's mother was in hospital and a good friend will most probably help in such situations without asking for much details, but your friend was smart enough that he called you because otherwise he would have lost his $2000 to a scammer. I think you've done a great job by telling us about that scamming tactic those scammers tried on your friend because such threads can educate others to be aware of such scams and they can then avoid being victim of such scams. AI is really going to cause much trouble in future, and that's why I think we should be well prepared to find solutions for those troubles in advance.