\documentclass{article}

\begin{document}
  \begin{align}
    [\hat{X},\hat{P}] = i\hbar
  \end{align}
\end{document}
