Changing Your Thoughts Vs. Talking To Someone

I feel and have been taught by other life coaches that it’s important to tell someone when they’re doing something that doesn’t work for you (ie. something disrespectful or inconsiderate to the point of being hurtful). I was taught that it’s important to do this so that the other person (and you) can course correct before their action becomes an emergency for you. At what point do you go from changing your thoughts around someone’s behavior to letting them know what’s not working, so that you’re not essentially letting people walk over you and just always being okay with it?