Page 31 of https://www.math.ntnu.no/emner/TMA4215/2008h/lecture9.pdf defines a set of orthogonal polynomials
$$ \phi_k(x) = x \phi_{k-1}(x) - \sum_{j=0}^{k-1} \alpha_j \phi_j(x), $$
starting from $\phi_0(x)=1$, in the way that $<\phi_m, \phi_n> = 0, \forall m\neq n$. The lecture note says "$\phi_k$ is orthogonal to all polynomials of degree $k − 1$ or less." Why?
Let $p_i$ be any polynomial of degree $i \leq k-1$, we have
$$ <\phi_k, p_i> = <x \phi_{k-1}, p_i> - \sum_{j=0}^{k-1} \alpha_j <\phi_j, p_i> $$
but how does it amounts to zero?
You can verify that Span$\{\phi_0(X),\dots,\phi_{k-1}(X)\}$ = Span$\{1, X,\dots,X^{k-1}\}$
That's because $\phi_j$ has degree $j$ for all $j$.
And by construction, $\phi_k\perp$ Span$\{\phi_0(X),\dots,\phi_{k-1}(X)\}$.