Detoxification or rather ‘detox’ for short, is the physiological or medical removal of a toxic substances such as alcohol or heroin.  It can additionally refer to the period of withdrawal during which your body returns to homeostasis after long-term use and abuse of an addictive substance.
Detoxification or ‘detox’ involves taking a short course of a medicine which helps to prevent withdrawal symptoms when you stop drinking alcohol or taking addictive drugs. The most commonly used medicine for detox of alcohol is chlordiazepoxide. This is a benzodiazepine medicine. For heroin it is subutex or methadone.