There are several different reasons why alcohol and medications can be dangerous in combination:
A publication by the National Institute of Health (NIH) gives details of some of the common medications you need to avoid alcohol with. However, this should be used as a starting point, rather than a definitive guide.
If you are a drinker, ask your doctor or pharmacist whether a prescribed medication can interact harmfully with alcohol. If you feel unable to abstain from alcohol while on a course of medication, you should have a frank discussion with your doctor about this, and explore other options. Your doctor may encourage you to consider treatment for alcohol dependence, but if you don't feel ready for this, you should insist on an alternative treatment or support with abstinence for the duration of the treatment, rather than take the risk of serious harm to yourself.
Of course, if you are taking illicit or non-prescribed drugs, it is more difficult to broach the subject with your doctor or pharmacist, but you are still advised to do so. Your doctor, in particular, can advise you on the best way to proceed if a medication that interacts with another drug you are taking is required for treatment. Although it can be difficult coming clean with your doctor, they can be one of your best allies if you live with an addiction, so it is worth establishing a trusting relationship.