Constrained Optimization using Lagrangian method
In general, FOCs produce local, not necessarily global, optima. Consider 
\begin{equation}
\max_x\;f(x)=x \sin(x) \quad\text{s.t. $x\in[0,7]$}.
\end{equation}

As the plot below shows, $f(x)$ has three stationary points in the domain $[0,7]$: $x_1=0$, $x_2\approx 2.03$, and $x_3\approx4.91$. Among them, $x_2$ is the local maximum that would be picked up by the FOC. However, the global maximum happens at the boundary, where $x=7$. Since $f'(7)\ne0$, the global maximum would be missed if you rely only on the FOC.