Whenever you do someone a favour or help them in any way by going out of your way, and they don't reply appropriately and you end up feeling used or unappreciated, it shows the true colour of the other person, who is not your type of person, therefore to be avoided the next time. She or he is selfish or thoughtless or a user or whatever and you are the opposite so you don't have the most basic thing in common with them. So next time don't help them. Even if they ask, give your conditions such as "Cant do it, I am busy with something else" etc. When you value yourself & your own time and show it, they will respect you more.
What they say is true, Do wrong me once, shame on you, do wrong me twice; shame on me. If someone make you feel used once, drop them. Don't give them a second chance. Give them the message that you won't tolerate it the next time.
Also if you decide to help someone, keep in mind that the other person might not reply the way you would expect. If you can afford to give without getting anything in return, then fine help them. Only give what you don't mind losing. When you don't invest too much, you won't lose out too much.
Remember, in your own world, in your relationship with your peers and colleagues and friends; you are the number one. So don't offer your help at the expense of your own needs. Never put yourself in second place. They will not notice whether your offer is at the expense of your own needs or not, all they will see is, that you are offering them something they want, and they'll happily take it without thinking whether it was a big deal to you or not. Because in their own world, they are the number one. And they take it. That's the rule of the game. People are programmed to prioritise themselves.
Also, in general relationships with friends and colleagues, never be too open and too accommodating. Always hold something back about yourself. Never open up too much. If they think they know you like an open book, they will take you for granted. If they there are things they don't know about you, they'll approach you differently compared to someone they take for granted.