To set limits / To set boundaries
Used in personal, professional, and educational contexts for establishing what is and isn't acceptable.
It's important to set boundaries at work.
She learned to set boundaries with people who were hurting her.
—How do you handle it? —By setting clear boundaries from the start.