Sometimes when my boyfriend and I fright and he's yelling at me I lash out and hit him, what can I do to help control myself?

I don't want to hurt him anymore, I need help, I grew up in a kinda abusive household and have a strong history of selfharm and think that's part of my problem.
Sometimes when my boyfriend and I fright and he's yelling at me I lash out and hit him, what can I do to help control myself?
Post Opinion