We cannot prevent having Fentanyl available. What we can do is have consistent purity and dosage to help prevent accidental overdoses. We can also lower the cost so that we eliminate the illegal drug trade and the associated violence. At the same time by making recreational drugs more affordable, we can minimize secondary criminal activity related to getting money for drugs. It would no longer by on the streets but in licensed pharmacies. We can also offer counseling and drug treatment options to users to improve treatment and lower the number of addicts. And, like in Portugal we can identify problem drug users in critical jobs where recreational drug use is not appropriate.
As for guns, this would minimize the drug related gun violence which is a substantial component to the topic of this thread.
The savings already outlined plus the improved standard of living for people currently caught up in drug use, drug trade or legal problems associated with them, will make legalization even more worthwhile.