how do I stop letting people who have wronged me back into my life?

I (21F) have this chronic issue ever since elementary school that I will have friends that I allow to backstab, disrespect, betray, and flat out pathologically lie to me. and it's the weirdest thing because I feel the anger as it's happening, I've vent about it for days and days afterwards. sometimes even weeks. but then there will always come a certain amount of time when I just sort of move on from it and allow the person back into my life. not even just move on, but sometimes fully forget about the wrongdoing.

I don't have a therapist yet, but I hear therapist online talk about how healthy it is to forgive people because it saves your mind from unnecessary stress. but they also put emphasis on not forgetting. because that's the cycle you get into where you allow people to continually hurt you over and over again. and unfortunately I find myself stuck in this cycle all the time.

I want to build strategies. there's someone in my life right now that continually hurts me over and over again but they're always comes a day that I totally forget and I let them right back into my life again. and then I hurt me all over again. and I'm so sick of it.

any advice?