The Chi² test is used to compare two proportions from two or more groups. It helps to conclude if there seems to be an association between two factors or two diseases or a factor and a disease. A contingency table is used to run the test and it has to get at least a value > 5 in each case.
This test could be used if you want to test if the repartition of your patients between modalities of a variable. For example, if you want to know if there is an association between the variable tobacco having three modalities "smoker", "no smoker" and "former smoker" and the variable Chronic Obstructive Pulmonary Disease (COPD), this contingency table will be made :
|Tobacco / COPD||COPD positive||COPD negative|
From this example (virtual data), you will obtain a p-value from the Chi² test : p < 0.0001. Thus you should conclude that the variable tobacco should be associated with the variable COPD in the target population.