Lots of times God sent a bad spirit to make Saul angry. So David used to play his guitar to make him feel better. Then the bad spirit went away, and Saul felt better.