I'm sorry you're having a bad time. I went through similar struggles where I was really nice and people took advantage of me.
I find that being nice because that's the person you want to be (and not doing it for reciprocation) is a great way to live. People will do what they want, but I'm proud of myself for being a compassionate person and for evolving. Remember that you can be your own best friend. Being nice in general also means being nice to yourself. Even though others are not nice to you, you still deserve self-compassion.
It's okay to set boundaries and put yourself first. You can cut people out without being mean or disrespectful. It's acceptable to not expend a lot of energy on people who don't reciprocate. If someone is taking from you, just say "Hey, I know you need things but I'm busy and I have to focus on other things". You can find a nice way of saying that.