Which formula to use to find the pH of a solution? I just had my first exam yesterday, and I'm always tripped with this question that combines neutralization with buffer solution. The task is to find the pH. I did try to understand the general concept behind it. From my understanding, if $\ce{CH3COOH}$ reacts with $\ce{NaOH}$ and the acid has a higher amount of substance ($\pu{0,005 mol}$ vs $\pu{0,004 mol}$), it means that $\pu{0,005 mol}$ of acid is used to neutralize $\pu{0,004 mol}~\ce{NaOH}$, and $\pu{0,001 mol}$ of $\ce{CH3COOH}$ will remain together with $\pu{0,004}~\ce{CH3COONA}$.

To find the pH, one has to use the Henderson-Hasselbach equation and divide the amount of substance with the volume, with $\mathrm{pH} = \mathrm{p}K_\mathrm{a} - (\log c(\ce{CH3COOH})/c(\ce{CH3COONa})$. And then if $\ce{NaOH}$ has a higher amount of substance ($\pu{0,0051 mol}$ vs $\pu{0,005 mol}$ acid), it would create $\pu{0,0001}~\ce{NaOH}$ and $\pu{0,005}~\ce{CH3COONa}$.

So to find the pH, you need to find the pOH of $\ce{NaOH}$ first. So far so good. But in the solution to the problems posted, there's suddenly an acid popping up in the solution and you have to use Henderson/Hasselbach equation. For example $\ce{NH3}$ reacts with $\ce{HCl}$ and creates $\ce{NH4Cl}$, even if you have a bigger amount of substance for $\ce{NH3}$, you still get an acid on the result... I'm so confused. And then there's an example with the coefficient ($\ce{Na2CO3 + 2HCl -&gt; 2NaCL + H2CO3}$). If $\ce{Na2CO3}$ has a higher amount of substance (let's say $\pu{0,224 mol}$) and $\ce{HCl}$ only $\pu{0,0816 mol}$, does it mean that it would result in $0,224 \times 2 - 0,0816 \pu{mol}~\ce{NaCl}$ and $\pu{0,0816 mol}~\ce{H2CO3}$? I feel so stupid now that I can't understand this simple concept and keep making mistakes (and wasted like 8 points during the exam).
From reading your question it is obvious that you are confused. When I studied chemistry in college in the 1970's I don't remember the Henderson-Hasselbach equation being a famous equation. It seems like it is now being used as some magic can opener.

You need to go back to the chemistry and figure out the chemistry first, then do the math. 

Ok, let's start by noting that the pKa of acetic acid is 4.76 from Wikipedia. There are two significant figures in the mantissa so a mathematical solution good to 1% will be adequate. Also we are dealing with solutions on the order of $10^{-3}$ molar. This allows us to make two very important assumptions which significantly simply the mathematics.


First we assume that we can ignore the autoionization of water. 
Second we assume that since acetic acid is a weak acid the solution ends up being essentially 0.004 molar sodium acetate and 0.001 molar acetic acid.  


Because we have excess acetic acid we know that the solution will be acidic. If we wanted a more exact solution we'd ignore the second assumption and use the $K_\mathrm{a}$ expression 

$K_\mathrm{a} = \dfrac{\ce{[H^+][Ac^-]}}{\ce{[HAc]}}$

to solve the problem more exactly. Letting $\ce{[H^+]} = x$ then $\ce{[Ac^-]} = 0.004 + x$ and $\ce{[HAc^-]} = 0.001 - x$. This requires solving a quadratic equation which is doable, but mathematically messier.   

Now back to using our two assumptions we can go to the Henderson–Hasselbalch equation and solve the problem with a simple formula. 

$\mathrm{pH} = \mathrm{pKa} + \log{\dfrac{\ce{[Ac^-]}}{\ce{[HAc]}}} = 4.76 +  \log{\dfrac{0.004}{0.001}} = 5.36$

This means that the $\ce{[H^+]} = 4.4 \times 10^{-6}$. 


So our assumption that the final solution ends up being essentially 0.004 molar sodium acetate and 0.001 molar acetic acid is reasonable.  
The assumption that the autocatalysis of water can be ignored is a bit dicier.