How to assess a comorbidity? By what criteria can a comorbidity be determined in a diagnosis? Is it pretty much educated guess-work?

I'm casually studying the DSM-5... by what standards can one be confident that a disorder is accompanied by a comorbidity? Is it common to misdiagnose a disorder due to a concurrent comorbidity?
If we consider the field of psychiatry, usually a comorbidity is understood as the simultaneous occurrence of two or more mental disorders in the same person. But attention can also treat physical comorbidity, when there is coexistence of physical and mental pathologies for example. But that does not clarify your question. Sometimes DSM can help and sometimes cause confusion. What needs to be highlighted is the crucial role of clinical evaluation. It is through the evaluation process that we can understand the course of the disease development, its predisposing factors, current difficulties and the symptomatological evolution. A good assessment can see if and when there is a major disease and which diseases can act secondarily. Some symptoms may work together, some clinical conditions of comorbidity have a temporally defined course of action. Although the experience of the clinician counts a lot, we cannot ignore the remarkable role played by exams, tests and other diagnostic instruments. In the case of psychological assessment, which is my background, we can often see from the evidence that new insights are made into each case and from there, build a more effective intervention plan. Hope this helps. Good luck.Here you can find some more.