It doesn't solve problems but stops the pain. Frees you temporarily from thinking and deciding things under the influence of pain.
I don't get modern medicine. Grief, loss, loneliness (long term), stress and more mental/emotional ailments are found to be detrimental to human health, even causing most non-cancer chronic diseases. I would really like to see a study that somehow shows people surviving long term who were about so self-medicate with tobacco or alcohol, instead of survival rate that only takes into account the substance's harm.
Alcohol and cigarettes harmed me but they also helped me survive. It's not a black and white clear cut thing.