If you were previously easily affected by someone, something, or some situation, what do you do to change that?

I still let myself get affected by a couple of things, when I wish I didn't. What do I do?

it's nothing major, but things like seeing my ex-gf that cheated on me, a girl that rejected me in a shitty way, friends who stopped talking to you, you know, the type of stuff that kinda gets to you from time to time...