In the era of fentanyl, the overdose problem is largely caused by the black market nature of getting the drug, poorly mixed inactive ingredients with opiates which can have orders of magnitude difference in effective dose.
Overdose on legally manufactured drugs being much overshadowed by the black market sourced drugs.
It is difficult to come to conclusions about how much of the reactions are showboating and how much are legitimate, but it seems clear that the net negative outcomes can be minimized if you teach people about the drugs they want to take, allow them access to a reliable source, allow them access to treatment for misuse and addiction, and target the sources of suffering that lead people to try to escape with drugs.
The situation though is considerably more complex than just these points.