Answer
The maximum is $f(\pi/4) \approx-0.30349$ and the minimum is $f( 0 ) =-1$
Work Step by Step
Given $$y=\sqrt{2} \theta-\sec \theta, \quad\left[0, \frac{\pi}{3}\right]$$
Since
\begin{align*}
\frac{dy}{d\theta}&=\sqrt{2}-\sec \theta\tan \theta
\end{align*}
To find critical points
\begin{align*}
f'(t)&=0\\
\sqrt{2}-\sec \theta\tan \theta&=0
\end{align*}
Then $\theta= \pi/4$. Because $\pi/4\in [0,\pi/3]$, then $f(x)$ has a critical point $\theta=\pi/4$ , since
\begin{align*}
f(0)&=-1 \\
f(\pi/3 )& \approx-0.519039\\
f(\pi/4)&\approx-0.30349
\end{align*}
Then the maximum is $f(\pi/4) \approx-0.30349$ and the minimum is $f( 0 ) =-1$