Given. Objective $f(x,y,z)=x+y-2z$; constraint $g(x,y,z)=x^2+y^2+4z^2-1=0$ (a compact ellipsoid).
Find. The global maximum and minimum of $f$ on the ellipsoid.
Approach. The ellipsoid is closed and bounded, so $f$ (continuous) attains both a max and a min on it. Use Lagrange multipliers: $\nabla f=\lambda\nabla g$ together with the constraint gives exactly two critical points.
Set up the Lagrange conditions. $\nabla f=(1,1,-2)$, $\nabla g=(2x,2y,8z)$, so
$$1=2\lambda x,\qquad 1=2\lambda y,\qquad -2=8\lambda z.$$
Solving each for the variable: $x=y=\dfrac{1}{2\lambda},\qquad z=-\dfrac{1}{4\lambda}.$
Substitute into the constraint.
$$x^2+y^2+4z^2=\frac{2}{4\lambda^2}+\frac{4}{16\lambda^2}=\frac{1}{2\lambda^2}+\frac{1}{4\lambda^2}=\frac{3}{4\lambda^2}=1 \;\Rightarrow\; \lambda^2=\frac34 \;\Rightarrow\; \lambda=\pm\frac{\sqrt3}{2}.$$
Evaluate $f$ at both critical points.
$$f=x+y-2z=\frac{1}{2\lambda}+\frac{1}{2\lambda}+\frac{1}{2\lambda}=\frac{3}{2\lambda}.$$
For $\lambda=+\tfrac{\sqrt3}{2}$: $f=\dfrac{3}{\sqrt3}=\sqrt3$ (maximum). For $\lambda=-\tfrac{\sqrt3}{2}$: $f=-\sqrt3$ (minimum).