# I am confused as to how to get the hat symbol and my subscript directly above and below eachother as in the image

Whenever I try to do this i get them off to the side. when i am working with simple characters such as just an x and a y as my superscripts and subscripts it works but not when i am using complex ones

I think it's because you use \hat{e_x} instead of \hat {e}_x.
\documentclass{article}
$\mathbf{r} = 2\hat{e}_x + \hat{e}_y$