Psalm 32 says "My moisture is turned into the drought of summer," meaning that vital moisture in his vessel was drying up. "Summer" refers to the time of cutting off the harvest of fruit in areas that never get any rain. People who suffer with arthritis know what it means to lose precious moisture from their joints. The stiffness and inflammation cause excruciating pain with the slightest movement.
David's body was reacting to the wearing down of his natural defenses. But David got out of his cycles, his mood swings, and his guilt. First, he stopped living in denial. David knew where he stood. He said in Psalm 32:5, "I acknowledged my sin unto thee." He faced the reality that he had been living in his old sin nature for a year. David had been angry. He had no joy, he couldn't sleep, and he wouldn't get right because of pride and arrogance.
Then, he got a visit from the prophet Nathan. Nathan didn't speak smooth and flattering words. He told the king he needed to get right with God. Nathan went alone, with a purpose to draw the king back to God's side. It worked with David because God always honors His Word.