If I get treatment for one disorder, won't the other one just go away?
No. You need treatment for both (or all) of the disorders, and at the same time.
For example: let's say you’re depressed and you use cocaine as a way to cope with the depression. It's likely that you have become addicted to cocaine.
If you stop using cocaine, the depression won't go away because it was there in the beginning.
If you tried to get treatment for the depression, but continued to use, you'd likely not learn any new skills for coping. Why would you? Your old coping skill is probably still working, and working much more quickly than any new skills or medication would work.
In the end, you'd still be depressed and addicted.
Another example: say you've been drinking for years now, and the drinking has caused chemical changes in your brain, created legal and financial trouble, and led to a divorce.
These events have caused you a great amount of anxiety, and you find you're having panic attacks quite often.
If you quit drinking but still have panic attacks, how long do you think you'll stay sober? Probably not for long; you'll likely go back to drinking because of the discomfort of the panic disorder.
The bottom line is that if you have co-occurring disorders, you need treatment that addresses ALL of your issues simultaneously, or your chances of recovery are greatly reduced.