It was written in a book that if parity commutes with Hamiltonian and for some operator $\hat O$ if $P\hat O P^{-1} = -\hat O$ then $\langle\hat O\rangle = 0$.
I know how to show $\langle\hat O\rangle = 0$ using the condition $P\hat O P^{-1} = -\hat O$. But I do not understand from where this condition ($P\hat O P^{-1} = -\hat O$) comes and how it proves that this process is parity conserving?