Negative thoughts

Sa
Everytime my S/O yells at me or is angry I automatically start telling myself how horrible of a person I am and why would I do what I did that made him angry and sometimes wonder what I did to make him yell at me or get angry. I haven't always done this, in the past if I've gotten yelled at by my parents I'd just be quiet about it and stay in my room for awhile but I'd never tell myself I'm an awful person. This has recently started.