The trick is to write the $j$-invariant function in terms of Eisenstein series, whose $q$-expansions have a simple expression. See Silverman's "Advanced Topics in the Arithmetic of Elliptic Curves", Chapter 1, Section 7, and in particular, Proposition 7.4 and Remark 7.4.1.

In particular 
$$j(\tau) = 1728\frac{g_2(\tau)^3}{\Delta(\tau)}=1728 \frac{g_2(\tau)^3}{g_2(\tau)^3-27g_3(\tau)^2} = \frac{\left(1+240\sum_{n\geq 1}\sigma_3(n)q^n\right)^3}{q\prod_{n\geq 1}(1-q^n)^{24}}.$$