Guilt protects a fantasy that she/they could have saved him. Reality is drugs/lifestyle killed him, not " no contact".
Your friend could probably benefit from grief counseling.
As to what to say....."I am so sorry for your loss-drugs are terrible" comes to mind.