Wa ‘Alaikum Salaam,
This is an excellent question that, unfortunately, we need to be aware of in today’s climate. Fortunately, there are many solutions available in Islam to help us better deal with difficult people and set boundaries with those who behave inappropriately.
Repel that which is evil with that which is better. Rather than retaliating and fighting back with people, we are advised by Allah (swt) to return a bad gesture or act with something that is better. This could even be as simple as remaining silent. Arguing back with someone or aggressively trying to enforce boundaries can only lead to conflict and feelings of disrespect. A calm, respectful approach means the other party is more likely to comply with your instructions as well as have more respect towards you. If they see your calm response, this will help them to calm down too and behave more appropriately.
Be patient. If someone is not doing anything haram or against Islam then there is no need to get upset or angry about it.
Make du’aa’ for them. If someone is behaving inappropriately, the one who can guide them more effectively than anyone is Allah (swt). You might not be able to guide them to appropriate behavior, but Allah (swt) can.
Gently advise them. If the person is doing something haram or unacceptable, you can gently advise them on the matter without doing so aggressively. They are more likely to respond to you if you are gentle about it. Perhaps they don’t even realize they are pushing boundaries or being inappropriate.
Leave them to Allah (swt). If they don’t respond to your gentle advice, then leave them to Allah (swt). If they are doing something wrong, then nothing you can do is going to more punishing than what Allah (swt) can do.
Don’t get angry. If you get angry with the person you’re more likely to say or do things that you might later regret. Instead, do wudu, sit or lie down, or simply walk away.
Control your tongue. This is one of the organs of the human body that our Prophet (saw) advised us to control. There can be terrible consequences that come out of saying bad things about or to others. When in a state of anger or upset, we often tend to say things that are hurtful and out of character and you might later regret the words you uttered at such times.
Don’t judge them. It may be that there is a rational reason for their behavior that you are unaware of. It may be that they are going through a difficult time and are actually in need of support. Alternately, they might not realize that they are pushing boundaries or behaving inappropriately.
May Allah (swt) guide us all to maintain boundaries and observe appropriate behavior in the light of Islam. May He (swt) also guide us to respond to these situations in ways that are compatible with Islam and most pleasing to Allah (swt).
Disclaimer: The conceptualization and recommendations stated in this response are very general and purely based on the limited information provided in the question. In no event shall AboutIslam, its counselors or employees be held liable for any damages that may arise from your decision in the use of our services.