Answer: The Bible says in Romans 8:28, "And we know that all things work together for good to those who love God, to those who are the called according to His purpose."
God can and does relieve spiritual and physical pain. Christ performed hundreds of healing miracles with the most important ones being spiritual where the deaf and blind actually heard the gospel and saw the manifestation of the coming kingdom of God though the miracles performed by Jesus.
We can choose to be discouraged when healing is delayed and the pain continues. We can also pray and choose to practice faith when relief is delayed. Isaiah 40:31, "But those who wait on the LORD Shall renew their strength; They shall mount up with wings like eagles, They shall run and not be weary, They shall walk and not faint."
King David wrote in Psalm 22:1, "My God, My God, why have You forsaken Me? Why are You so far from helping Me, And from the words of My groaning?"
Psalm 22:6, "But I am a worm, and no man; A reproach of men, and despised by the people. All those who see Me ridicule Me; They shoot out the lip, they shake the head, saying, 'He trusted in the LORD, let Him rescue Him; Let Him deliver Him, since He delights in Him!'"
Psalm 22:14, "I am poured out like water, And all My bones are out of joint; My heart is like wax; It has melted within Me. My strength is dried up like a potsherd, And My tongue clings to My jaws; You have brought Me to the dust of death. For dogs have surrounded Me; The congregation of the wicked has enclosed Me. They pierced My hands and My feet; I can count all My bones. They look and stare at Me. They divide My garments among them, And for My clothing they cast lots."
Did God answer David's prayer? Yes these scriptures represent the fulfilled prophecy of Christ's death and sacrifice. He endured the shame. His hands and feet were pierced and His garments were divided among His enemies and in the end Jesus concluded His physical life with the opening sentence of Psalm 22, "My God, My God why have you forsaken me?" clearly identifies Christ's suffering with David and ultimately with us.
God does care for us and at times He allows pain and suffering so that we can shift our focus away from this temporary life and look towards His coming kingdom and what He has in store for us. 1 Corinthians 2:9 (ESV), "But, as it is written, 'What no eye has seen, nor ear heard, nor the heart of man imagined, what God has prepared for those who love him.'"
Part of taking away pain is to learn to not be consumed with the cares of this life and focus our minds and spirit on a future glory (Mark 4:19).
Romans 8:18-25 (ESV), "For I consider that the sufferings of this present time are not worth comparing with the glory that is to be revealed to us. For the creation waits with eager longing for the revealing of the sons of God. For the creation was subjected to futility, not willingly, but because of him who subjected it, in hope that the creation itself will be set free from its bondage to corruption and obtain the freedom of the glory of the children of God. For we know that the whole creation has been groaning together in the pains of childbirth until now. And not only the creation, but we ourselves, who have the firstfruits of the Spirit, groan inwardly as we wait eagerly for adoption as sons, the redemption of our bodies. For in this hope we were saved. Now hope that is seen is not hope. For who hopes for what he sees? But if we hope for what we do not see, we wait for it with patience."