We study the metric projection onto the closed convex cone in a real Hilbert space $\mathscr {H}$ generated by a sequence $\mathcal {V} = \{v_n\}_{n=0}^\infty $. The first main result of this article provides a sufficient condition under which the closed convex cone generated by $\mathcal {V}$ coincides with the following set:
$$ \begin{align*} \mathcal{C}[[\mathcal{V}]]: = \bigg\{\sum_{n=0}^\infty a_n v_n\Big|a_n\geq 0,\text{ the series }\sum_{n=0}^\infty a_n v_n\text{ converges in } \mathscr{H}\bigg\}. \end{align*} $$ Then, by adapting classical results on general convex cones, we give a useful description of the metric projection onto
$\mathcal {C}[[\mathcal {V}]]$. As an application, we obtain the best approximations of many concrete functions in
$L^2([-1,1])$ by polynomials with nonnegative coefficients.