No, you shouldn’t conclude that God is punishing you for something you’ve done wrong. Sometimes we do bring bad things on ourselves by deliberately doing something wrong that will hurt us — but from what you say, this isn’t true in your case.
Often we don’t know why God allows pain and suffering to come our way. We all live in an imperfect, sinful world, and none of us are exempt from its sorrows. No one served Christ more diligently or had a stronger faith than the Apostle Paul, and yet he often experienced unremitting pain — what he called “a thorn in my flesh” (2 Corinthians 12:7). We’d all like to avoid pain and suffering — but unfortunately we can’t this side of heaven.
But we do know this: God knows what is happening to us — and He loves us and cares about us and wants to help us. I know it’s hard to believe this when we’re facing pain and suffering, but it’s true. We know it because His Son suffered far more than any of us ever will — the physical and spiritual suffering of the cross. The Bible says, “Christ suffered for you, leaving you an example, that you should follow in his steps” (1 Peter 2:21).
Get the best medical advice you can — and follow it. But more than that, turn your heart and mind to Christ, and ask Him to help you overcome your discouragement and weakness. His love for us never ends — and ahead of us is heaven.