This is an interesting question because in general there is no unique answer, although there is a "natural" answer for the simplest observables, which include $xp$. The lack of uniqueness is linked to the ordering problem.
The simplest quantization is due to Dirac; he tried to implement the idea that the commutator of two operators representing observables should be $i\hbar$ times the operator corresponding to the Poisson bracket of the two respective classical quantities.
This is based on the observations that
\begin{align}
[\hat x,\hat p]=i\hbar \widehat{\{x,p\}}
\end{align}
where $\{\cdot,\cdot\}$ is the classical Poisson bracket. Dirac basically proposed to generalize this to
\begin{align}
[\hat f,\hat g]=i\hbar\widehat{\{f,g\}} \, . \tag{1}
\end{align}
subject to the additional assumptions that
\begin{align}
\widehat{f(x)}=f(\hat x)\, ,\qquad \widehat{g(p)}=g(\hat p)
\end{align}
The problem is that (1) eventually fails although it does work for $xp$. To get the result you want you need to ask what is $\widehat{xp}$. To get there start with
\begin{align}
\frac{1}{i\hbar}[x^2,p^2]&=2\left(\hat x\hat p+\hat p\hat x\right)
=\widehat{\{x^2,p^2\}}= 4 \widehat{xp}
\end{align}
from which you get
\begin{align}
\widehat{xp}=\frac{1}{2}\left(\hat x\hat p+\hat p\hat x\right)
\end{align}
which is the usual symmetrization rule.
Gronewold in
Groenewold, H.J., 1946. On the principles of elementary quantum mechanics, Physica 12 (1946) 405-460,
showed that (1) eventually fails, i.e. there is no rule consistent with (1) that will allow you to find, for instance, the operator corresponding to $x^2p^2$. This is excellently reviewed in
Chernoff, P.R., 1981. Mathematical obstructions to quantization. Hadronic Journal, 4(3), pp.879-898.
The remarkable thing is that of course the rule (1) works for the ``most common'' observables like angular momentum. However, it is possible to devise classical Hamiltonian for which the quantization is not unique, as per the example of this post.