There are many ways to help make that determination.
Depending on your job, there are tests to determine if your body has been exposed to certain chemicals. Lung function testing can measure any effect of these chemicals, and blood testing can identify antibodies against the chemicals as well. It's also important to note your symptoms when you're away from work. If they improve, that's key.