Put (someone or something) out of one`s head or mind

To try not to think about someone or something.

My friend has been trying to put his girlfriend out of his mind since they stopped seeing each other.