Many believers seem to have this notion that setting limits with others by turning down requests and/or distancing themselves from others to take some time for themselves is not a righteous thing. Even if the person is cruel many people think that to be truly righteous you must continue to tolerate others bad behavior, no matter how bad it is in the name of forgiveness and mercy.
But this common notion is actually rooted in a misunderstanding of God. It is not godly to live without boundaries. God Himself has boundaries and sets limits with us. "For the upright will live in the land and the blameless will remain in it; but the wicked will be cut off from the land and the treacherous will be uprooted from it." Proverbs 2:21-22
God loves everyone and sets behavioral expectations for us in order to have a close relationship with Him. God sets limits on the kind of people He will spend time with. This is not unloving or a contradiction; what is unloving is allowing evil to continue and enabling it by supporting others in wickedness by not saying no. The Bible says, "The prudent see danger and take refuge but the simple keep going and pay the penalty." Proverbs 22:3. It is not prudent or loving to continue to place yourself in or encourage others to stay in dysfunctional situations. The Bible is very clear on this. You are not helping God by neglecting the work God has given you to please others.
"Now it happened when Sanballat, Tobiah, Geshem the Arab, and the rest of our enemies heard that I had rebuilt the wall, and that there were no breaks left in it (though at that time I had not hung the doors in the gates), that Sanballat and Geshem sent to me, saying, 'Come, let us meet together among the villages in the plain of Ono.' But they thought to do me harm. So I sent messengers to them, saying, 'I am doing a great work, so that I cannot come down. Why should the work cease while I leave it and go down to you?' But they sent me this message four times, and I answered them in the same manner." Nehemiah 6:1-4
People that try to get you to stop building up the walls in your life that God called you to build in order to meet their own wishes are not your friends. "When Sanballat heard that we were rebuilding the wall, he became angry and was greatly incensed. He ridiculed the Jews." Nehemiah 4:1 And when you start building boundaries you may be ridiculed too.
Sometimes when building your boundaries you will have to say no to someone more than once, but you should be brave enough to not cave in and say yes to something that is not best for you and your relationship with God. And no, wanting what is best for you isn't automatically selfish when you consider that your body and time belongs to God and you are obligated to keep it in the best condition possible in order to serve Him and others by not taking on more than you should bear and neglecting your own duties.
""Listen to Me, you who follow after righteousness, you who seek the Lord: look to the rock from which you were hewn, and to the hole of the pit from which you were dug. Look to Abraham your father, and to Sarah who bore you; for I called him alone, and blessed him and increased him.'...Thus says your Lord, the Lord and your God, who pleads the cause of His people: 'See, I have taken out of your hand the cup of trembling, the dregs of the cup of My fury; you shall no longer drink it. But I will put it into the hand of those who afflict you, who have said to you, "Lie down, that we may walk over you." and you have laid your body like the ground, and as the street, for those who walk over.'" Isaiah 51:1-2 & 22-23.
"Awake, awake! Put on your strength, O Zion; put on your beautiful garments, O Jerusalem, the holy city! For the uncircumcised and the unclean shall no longer come to you. Shake yourself from the dust, arise; sit down, O Jerusalem! Loose yourself from the bonds of your neck, O captive daughter of Zion! For thus says the Lord: 'You have sold yourselves for nothing, and you shall be redeemed without money.'" Isaiah 52:1-3.
Stop selling yourself for nothing. In order to do this you must remember your value as someone who belongs to God and that God's plan for your life is important. When the world says let me walk all over you God says get up. The Lord would not have us forget to set appropriate boundaries in our life.