The most important element in answering this question is determining whether current drug or alcohol abuse is a proximate cause of your disability. If it is, then your claim will likely be denied. The reason being that, if you stopped abusing drugs and alcohol, you wouldn’t have a disability. Beyond this, it gets more complicated.
If you have a disabling condition and it is the result of past drug or alcohol abuse, that won’t affect whether or not you get your claim. For example, if you have emphysema from a long-term drug smoking habit but are and have been clean for some time, this shouldn’t affect your eligibility and the emphysema will be the determining factor in whether or not you get your benefits.
The Social Security Administration will look at your medical records, however, and these can be problematic. Your doctor will have noted whether they suspected that you were abusing drugs. If they have noted as much, it will appear in your records and the SSA may take this as a reason to turn down your claim. Make sure you review your medical records before you apply.
In some cases, the SSA may not believe that you have overcome your addiction. They may have a representative payee arrangement set up for you if this is the case. Under these arrangements, the representative payee gets your benefits and is in charge of giving you your money on an as needed basis, which includes them paying all of your regular debts.