When to end a relationship/friendship?

I am working on my rules and boundaries. And I am seeing, learning and changing the way I am feeling about that. I can also see how my thoughts and feelings are the reason why I feel the way I feel. But when is enough enough? Yes I can change the way I feel and feel better, but that doesn’t necessarily mean that I still have to be around or be with that person. So when is someone really overstepping and when is it really just my mind? I will give 2 examples.

I was in a dating stage with a guy who really seemed to like me but then he seemed to be really full on, so I said I wanted to take things slow. Eventually I went over for dinner to his place and lots of things happened within that one eve, like him leaving me in his apt to help out a friend, not really having prepped dinner and then me eventually falling asleep because I was tired and hungry, waking up with a hypo and a message of 30 min ago how he would be back soon. I then said I was leaving as I needed food and to rest. As I left, he came back and begged me to stay for dinner. He cooked dinner, tucked me in on the couch and I still felt sick so he wanted me to stay. I overstepped my own boundary there by not taking things slow. And even after mentioning it again, mentioning trauma and eventually when it led to sex and saying no it was just hard for me to step away from it. There is a lot of thoughts/past/actions underneath this story and there is way more that happened during and after, but this is I think the first bit where I intuitively felt I wasn’t empowered in who I want to be. I had to end this relationship, but what I am trying to learn here is, what could I have done/thought/felt better for my own sake, so that I feel empowered next time and have control over my own doing?

Other story is about a friend who is quite flaky and often cancels. In my head I’ve been putting that as she prefers other people over me, I am just a last resort when she doesn’t have anything else to do, I am not good enough for her. I have addressed why I feel this way (due to past) and that I am trying to not portray that onto our friendship. I asked her if it is possible for her to explain to me the reason why she cancels or send me a message every now and then. The thing I struggle with here is what I am going to do and feel regardless if she doesn’t respond back or explains herself. And do I continue a friendship if she keeps on cancelling the things we’d plan together?