Suffering by thinking about other’s suffering

A loved one recently went to jail and they are awaiting their hearing. I love this person and think that the person’s actions were caused by their own mental suffering, although that’s not an excuse for what they’ve done.

I feel sadness and despair thinking of them suffering alone in jail. I feel guilty as I believe that I could have somehow been there more for them and that I could have prevented them from going to jail in the first place had I done more to support their emotional well-being. I feel overcome by my emotions.

How can I go about disentangling my thoughts, so that I can be at a place where I’m not ruminating about their suffering, find some peace and offer them love through this process?