The sample equivalents of your moment conditions are
$$
g_1 = \frac{1}{n}\sum_{i=1}^n \left(Y_i - \frac{\theta}{2}\right)
$$
and
$$
g_2 = \frac{1}{n}\sum_{i=1}^n \left(Y_i^2 - \frac{\theta^2}{3}\right)
$$
By changing $\theta$, you can in general not set both conditions equal to zero simultaneosuly. The idea of GMM is to still take both conditions into account in the estimation process. The procedure works like this: stack $g_1$ and $g_2$ into the vector $g$ and minimize its weighted quadratic form:
$$
\hat{\theta} = \arg \min_\theta g'Wg
$$
With $W$ the weighting matrix. You can just set $W = I$, but the efficient choice is to set it equal to the inverse of the covariance matrix of $g$, $\Sigma_g^{-1}$. Since the latter depends on the unknown $\theta$, you proceed iteratively: first compute $\hat{\theta}$ using $W_0 = I$, then setting $W_1 = \Sigma_g^{-1}$, recomputing $\hat{\theta}$ and $W_2$ and so on. You continue until $\hat{\theta}$ converges, which should typically happen after five steps or so. This is also called $k$-step GMM. An extension to higher moments should be straightforward.