For a person who is hurt a lot, it is very difficult to trust other people, hence they may also be suffering from loneliness and hopelessness.
From the perspective of the bible, only love can heal wounds. To help a person who is hurt and secluded, one needs to show them a lot of love even it means death. Like Jesus - who wanted to reconnect humanity with God, he had to die to show man God’s love and gain his trust towards God. So whenever we feel hopeless, we look at the cross to gain confidence in the love of God, ultimately gaining confidence to live. Similarly people who are hurt should be proven otherwise that they are loved.
There are chances where people who are hurt will continue to misunderstand you more when you show love because of the mistrust developed in them through the process of hurt. Some cases people are just unwilling to accept our love, they don’t want to expose their hearts and keep it dark. As a person who cares for others - we need to be very discerning - knowing the exact position of the person and try to show love in a way that he/she can understand that you are loving him/her.
This process can take a longer time to build up and bear fruit. But I am quite sure that there is no other way. Hope this helps!