If someone is sending you a thousand text messages, and giving you a thousand phone calls because they are in a desperate life situation, you are likely to feel harassed and depressed at some point. You are also likely to feel that you are trapped; how can you ignore their text messages and phone calls? They are in a desperate situation, and you are not heartless.
But you are not trapped. They are trapped.
How much of their messaging and phoning is about the hard facts of their desperate life situation? How much of it is about practical things you can do as a friend to help? And how much of it is about how they feel, about their drama?
They are trapped in their own drama, and responding to every text message and every phone call is simply feeding their drama – allowing them to have more drama about the situation. This is why they are trapped. You keep them trapped every time you indulge them in their wants.
The best way to help in that situation is to deny them their wants. This feels wrong and heartless. But it is compassionate in this situation. Deny them their wants and they will have to face them for themselves.
Make it clear that if they request something practical that you can do to help then you will be there. But otherwise you cannot help them. This will save you from being abused, and wake them out of their own drama / dukkha.