You attract a certain type of person because you don't value yourself enough to trust that your boundaries are reasonable and you don't enforce them unless they are hugely violated. People that are emotionally healthy are able to do trust their boundaries and enforce them when they are violated.
I'm learning how to do it late in life.
I'd guess that you grew up in an environment that didn't allow you to acknowledge your needs and/or you're depressed. Counseling helps for both, but it might take a few different ones to find the right person for you. If money is an issue, many counselers will do sliding-scale, so what you pay is based on how much you make.