Center hrule in the middle of the page
You can replace
\hrule width 0.5\textwidth
with
\rule{0.5\textwidth}{.4pt}
Also, if you don't need the center
environment for anything else, you can replace
\begin{center}
\rule{0.5\textwidth}{.4pt}
\end{center}
with simply
\noindent\hfil\rule{0.5\textwidth}{.4pt}\hfil
MWE
\documentclass[10pt,a4paper]{article}
\begin{document}
Hello everyone !
\begin{center}
\rule{0.5\textwidth}{.4pt}
\end{center}
\noindent\hfil\rule{0.5\textwidth}{.4pt}\hfil
\end{document}
Output