Deriving First Order Condition of Hansen and Singleton (1982)
This has nothing to do with GMM, which is a statistical method for estimating parameters. This is a macroeconomics model or say a dynamic optimization problem.
From FOCs for $C_t$, $C_{t+1}$, and $Q_{jt}$, youg can get $$\mathbb{E}\frac{\beta U'(C_{t+1})}{U'(C_t)} = \frac{\lambda_{t+1}}{\lambda_t}$$, and $$\lambda_t P_{jt} = \lambda_{t+1} P_{jt+1}$$.
Then by replacing $\lambda$ you have $$P_{j t} U^{\prime}\left(C_{t}\right)=\beta \mathbb{E} \left[P_{j t+1} U^{\prime}\left(C_{t+1}\right)\right]$$.