What do I do with this problem?

Hi, so I had this friend and with her actions towards me I started to wonder If people that see me , get the vibe from me that I dont know how to defend myself which makes them say whatever they want. The friend Im talking about constantly gets irritated with me , complaining about every single thing I do , I could literally be just walking and she would have problem with it and be mean to me. One day i had enough and told her: “I’m tired and hurt with the comments you make, complaining about every single thing I do , making me feel uncomfortable around you, I would like you to stop , because it makes me not enjoy your company.” Eventhough I told her , it seemed like she did not care , because the next day she was doing the same thing all over again. I know you would probably say that if I don’t like her behaviour than I should just stop seeing her, but I just want to know for the future how to dea with this behaviour and not be seen as a person you can disrespect and be mean to without feeling bad about it. It just makes me feel small and not ready for this world if at this point I cannot even defend myself. It also hurts my pride because who the heck does she think she is to tell me this. Can anyone help me out with an advice please?
What do I do with this problem?
Post Opinion