$$2KClO_3 \rightarrow 2KCl + 3O_2$$
From the equation, we can see that 2 moles of potassium chlorate are required to produce 3 moles of oxygen gas. Therefore, to produce 6 moles of oxygen gas, we need:
$$6 \text{ moles O}_2 \times \frac{2 \text{ moles KClO}_3}{3 \text{ moles O}_2} = 4 \text{ moles KClO}_3$$
Therefore, 4 moles of potassium chlorate must be used to produce 6 moles of oxygen gas.