If you are a perfectionist, pipe smoking can cause some anxiety when first figuring things out, especially if you are unfortunate and have read up on how you are supposed to smoke a pipe and what you are supposed to be getting out of it. It is best to learn to smoke a pipe without knowing what you are supposed to be doing, and figure things out on your own with time. That said, the amount of time you spend thinking to yourself "danger! danger! my pipe is going out, my pipe is going out!" tends to be very effective at getting your mind off other trains of thought.
On a more serious note, I have dealt with depression in the past, went on for about 10 years. Resulted in a lot of self destructive behavior that created a positive feedback loop that just made things worse and worse over time. I eventually got over it through a perfect storm of events that resulting in me coming to the realization that I do have free will and that I was choosing to be depressed to give myself a free pass to be self destructive. The thing about being self destructive is that it is actually quite enjoyable and cathartic,as it general consists of some type of excessive hedonism of sorts. However, with this behavior comes guilt and shame, and that's no fun. As such, I needed some way to rationalize the behavior and fool myself that I shouldn't feel guilty about it, and the whole "whoa is me, I am so cursed, I am just a failure, there is nothing I can do, it's just my condition, it will always be the same, it's all hopeless and meaningless, I don't care if I die, there is no future so there is no reason to be responsible" worked wonderfully. This rationalization requires one to constantly focus on one's failures, many of which are self-inflicted as failure means I get to be a hedonist again guilt free. It's probably all sounds very convoluted to others, but in a nutshell, I was depressed because I was a narcissist, and I then used that depression to rationalize that it was okay for me to be narcissistic because I was afflicted.
Depression is different for everyone though, so I don't want to say that the above explains why others might be dealing with depression. It was just my deal. The DSM does a great disservice to understanding the human mind, as it grossly over simplifies dysfunctional thought processes by putting a label on them. As a result, modern psychiatry is mostly a travesty in that most practitioners are more interested in putting a label on things, so that they can then prescribe the proper drug for that label.
I am in the camp that believes artificially manipulating brain functioning through drugs to get the mood you want is ultimately a recipe for destruction. The mind is like an ecosystem, artificially modifying it to get the system you want tends to result in unintended consequences that throw the system further out balance. The human mind/body has natural ways to cope with dysfunctional thinking (exercise, meditation, talking, writing, isolation, etc.). Severe cases might require one to have to change the environment they live in. In the modern industrialized world, that can be very difficult to achieve. We don't all have a Walden Pond to retreat to when things get out of whack. That said, sometimes all that is needed is a perspective shift, to get out of the hole. In many cases, a good therapist can help lead you out of the hole by showing you a different way to see reality, and they should not need to prescribe you drugs to do so.
Severe forms of dysfunctional thought processes like the OCD described above, schizophrenia, etc. might be beyond the reach of therapies that consist of instituting a perspective shift that results in a new paradigm of reality. Isolationism might be the only thing that will work in these cases, but there needs to be slow gentle changes to this environment over time, that the patient freely chooses, to ease back into the world, a world that it should be noted is also dysfunctional, but in a different way. However, having the same dysfunctional view of reality does make holding down a job easier.
Lastly, there is also something to be said about a devout belief in free will and the Divine doing wonders, but that unfortunately isn't for everyone, and it has been my experience that the internet is no place for such a discussion, so I will leave it at that.