Calculate the pH of acetic acid for a 0.02 M solution
This type of problem is best solved using the ICE (Initial Change Equilibrium) method.
First, write down the chemical equation and the law of mass action for this reaction.
$$\ce{CH3COOH &lt;=&gt; H+ + CH3COO-}$$
$$K_a = \dfrac{[\ce{H+}][\ce{CH3COO-}]}{[\ce{CH3COOH}]}$$
Second, determine the initial concentration of each of the three species. Make a little table to keep everything straight:
\begin{array}{lc} \hline
&amp;\ce{CH3COO-} &amp;\ce{&lt;=&gt;}&amp;\ce{H+} &amp;+&amp;\ce{CH3COO-} \\ \hline
\text{I}&amp; \pu{0.02 M} &amp;&amp;\pu{0 M} &amp;&amp;\pu{0 M} \\ \hline
\end{array}
At equilibrium, some of the acetic acid will be ionized. How much? We don't know right now, so let's have that be a variable; $x$. At equilibrium, the concentration of acetic acid will have decreased by $x$. How much will the concentration of $\ce{H+}$ and acetate anion increase? Since the stoichiometric coefficient of all species is 1, then those concentrations will increase by $x$. Let's add that to our table. Let's also write an expression for the equilibrium concentrations in terms of the initial concentrations and $x$.
\begin{array}{lc} \hline
&amp;\ce{CH3COO-} &amp;\ce{&lt;=&gt;}&amp;\ce{H+} &amp;+&amp;\ce{CH3COO-} \\ \hline
\text{I}&amp; \pu{0.02 M} &amp;&amp;\pu{0 M} &amp;&amp;\pu{0 M} \\ 
\text{C}&amp; -x &amp;&amp;+x  &amp;&amp;+x \\ 
\text{E}&amp; 0.02-x  &amp;&amp;x &amp;&amp;x \\ \hline
\end{array}
Now, plug these expressions into the law of mass action:
$$K_a = \dfrac{[\ce{H+}][\ce{CH3COO-}]}{[\ce{CH3COOH}]} = \dfrac{(x)(x)}{(0.02-x)}$$
As long as $x\ne 0.02$, which is very unlikely at equilibrium, we have a solvable quadratic equation:
$$K_a=1.8\times 10^{-5}= \dfrac{(x)(x)}{(0.02-x)}$$
$$3.6\times 10^{-7}-1.8\times 10^{-5}x-x^2=0$$
Some texts will encourage you to make the simplification $0.02-x \approx 0.02$ since $x&lt;&lt;0.02$, however, WolframAlpha can solve the original equation (and so can you).
The equation has two roots: $x=5.91\times 10^{-4}$ and $x=-6.09\times 10^{-4}$. The second one is nonsense (we cannot have negative concentrations).
If you make the assumption that $0.02−x \approx 0.02$, then the positive root is $x=6.0 \times 10^{−4}$, not a big difference given the significant figures. If you knew your initial concentration more precisely, this assumption would be invalid.
Now, we know what $x$ is. What do we still need to know to determine pH? How is $x$ related to pH?