This is an exercise in Evans's book PDE.
For $u \in C_c^\infty(U)$, we have $$ \int_U |Du|^2\leq (\int_U u^2)^{1/2} (\int_U |D^2 u|^2 )^{1/2}$$ by Holder inequality and divergence theorem.
Problem : Let $u\in H^2(U)\cap H^1_0(U)$. If $\partial U$ is smooth, then $u$ satisfies the inequality
Try (use hint in the book) : Let $v_k \in C_c^\infty (U)\rightarrow u$ in $H^1_0(U)$ so that we have $$ \int_U |Dv_k|^2\leq (\int_U v_k^2)^{1/2} (\int_U |D^2 v_k|^2 )^{1/2}$$
Here I have a doubt that boundedness of $U$ is missed. If $U$ is bounded, then there exists $w_k\in C^\infty (\overline{U})\rightarrow u $ in $H^2(U)$ Then for some $U\subset\subset V$ where $V$ is bounded open,
$$ \int_{V} |Dw_k|^2\leq (\int_{V} w_k^2)^{1/2} (\int_{V} |D^2 w_k|^2 )^{1/2}$$ where $w_k$ is an extension on $V$ s.t. support of $w_k$ is in $V$.
But how can we finish the proof ?
A correct hint is being incorrectly applied. You don't need to approximate $u$ in $H^2(U)$. Approximation in $H_0^1(U)$ is enough. Indeed, just notice that $H^2(U)\subset H^1(U)$ and $$ \begin{align} \int_U |Du|^2dx=\lim_k\int_U Du\cdot Dv_k\,dx=-\lim_k\int_U D^2u\,v_k\, dx\\ \leqslant \Bigl(\int_U |D^2 u|^2 dx\Bigr)^{1/2}\lim_k\Bigl(\int_U |v_k|^2 dx \Bigr)^{1/2}=\Bigl(\int_U |D^2 u|^2 dx\Bigr)^{1/2}\Bigl(\int_U |u|^2 dx \Bigr)^{1/2}. \end{align} $$