The Lang-Weil Estimate

I will prove the Lang-Weil estimate: if X is an absolutely irreducible variety of dimension n over a finite field of order q, then #X(\mathbb{F}_{q^r})= q^{rn} + O(q^{r(n-1/2)}) as r goes to infinity.