need help

i’m having nightmares of my ex and his new girlfriend this time last year he forgot my birthday and was cheating on me with her and beating me physically and emotionally he told me i didn’t deserve anything, i ended up in a mental hospital because he drove me crazy, i want him out of my head so bad! how do i get him out of my head? it’s making me depressed and i can’t do it anymore..