I'm struggling when it comes to understanding the commutive properties of the Bra-ket notation in quantum mechanics. I understand how to work with constants, bra and kets. However, the second I start introducing eigen-equations such as $$\hat{x}|x'\rangle = x'|x'\rangle$$ to solve problems like $$\langle\psi_p|\hat{x}|x'\rangle = x'\psi_p^*(x')$$ I instantly lose grip on the rules for the Bra-ket notation. Am I allowed to simply pull the $x'$ out of the bracket like this: $\langle\psi_p|x'|x'\rangle=x'\langle\psi_p|x'\rangle$?
My book only state the rules for operators between a bra and a ket, $\langle a|\boldsymbol{A}|b\rangle$, but not how to handle problem including eigen-equations such as this one.