Consider the following proposition:
If $\lambda$ is regular cardinal, $A \subseteq \lambda$ and $|A| < \lambda$ then there is $\alpha < \lambda$ such that $A \subseteq \alpha$.
Here's its proof taken from the book "Set Theory for the Working Mathematician" written by Krzysztof Ciesielski.
Let $\beta$ be an order type of $A$ (with respect to the $\in$-ordering) and let $f\colon\beta\to A\subseteq\lambda$ be an order isomorphism. Notice that $\beta < \mathrm{cf}(\lambda)$, since $|\beta| = |A| < \lambda = \mathrm{cf}(\lambda)$. So the set $A = f(\beta)$ cannot be unbounded in $\lambda$. This implies the existence of an $\alpha < \lambda$ such that $\xi < \alpha$ for all $\xi \in A$. Thus $A \subseteq \alpha$.
I don't understand the following line:
Notice that $\beta < \mathrm{cf}(\lambda)$, since $|\beta| = |A| < \lambda = \mathrm{cf}(\lambda)$.
Why would $|\beta| < \mathrm{cf}(\lambda)$ imply $\beta < \mathrm{cf}(\lambda)$?
Since you already know that $cf(\lambda)$ is a cardinal, you can argue as follows: if $\vert\beta\vert< cf(\lambda)$ then we must have $cf(\lambda)\ge\vert\beta\vert^+$ - but $\vert\beta\vert^+>\beta$. So we get $$\vert\beta\vert<cf(\lambda)\implies\beta<cf(\lambda)$$ as desired.