The strict way to do it is to always keep the operators inside either the bra or the ket. In other words, the expression ##\langle \psi_0 \vert \hat{H}_0 \vert \psi_1 \rangle## is formally ambiguous; it could mean either ##\langle \psi_0 \vert \hat{H}_0 \psi_1 \rangle##, where the operator is applied to the vector on the right, or ##\langle \hat{H}_0 \psi_0 \vert \psi_1 \rangle##, where the operator is applied to the vector on the left. However, many texts are not this strict and write the operator between the bra and the ket, leaving it to context to show which operation is meant--or relying on the fact that in many cases, such as the one under discussion, it doesn't matter.