Don't give up on them and walk away, see through the pain and pray longer and stronger on their behalf. Stand in the gap of whatever their struggles may be and help them fight the enemy. I know the power of prayer as a believer, I've seen prayer work in my own life so I believe it for others too. Its even more important because sometimes hurt people don't have the strength, mindset, or clarity to fight for themselves in the midst of their trials. So how can they get over hurdles without the help of prayer warriors and sincere intercession on their souls? We should P.U.S.H. (Pray until something happens). That's one of the common phrases spoken by the Girlfriends Pray ministry and it is so true.
One more thing to keep in mind with dealing with hurt people...pray for yourself. We need to prepared, clear-minded, and suited up to go to battle for someone else. If we're in our own feelings about something a hurt person has done to us, anger and pride can easily rise up. Pray so that your response to hurtful words and actions isn't serving evil. We have to pray for peace and forgiveness immediately so that we can speak Godly words and take Christ-like actions to help a hurt person through their journey. Even if the hurt wasn't directed towards us we should still cover ourselves in prayer so the enemy has no power over our attempts to save a soul, help God heal a friend, and bring deliverance to others.
So while its true that hurt people can often try to hurt other people. We as believers or even mature minded people have to see through the pain if we desire a better life for our hurt people and for ourselves if we're the one hurting. Don't walk away, don't give up or give in... Please stay and pray longer and stronger!
Sidenote: As I began to feel overwhelmed standing in the gap for numerous folks, my great aunt spoke this to me. "You have to pray for their souls believing and trusting in God and not take on the emotion of their situation. If you take on the emotion of their situation, you won't be prepared to pray for the next person that is placed on your heart".