Somatic pain isn’t really pain that is in your head, although that is an easy way to look at it. Somatic pain is a process of a mental or emotional feeling or stress that becomes a physical feeling. The feeling is very real to the person and the brain is interpreting it as very real.
Treatment of somatic pain varies, depending on the person and the cause of the pain. Psychological counseling and medication may help one person, while stress reduction may help another. There are various techniques that have been developed as well, such as mirror therapy for people who have lost an arm.
If someone who has lost a hand or arm is feeling pain from the muscle contractions, they may feel relief by seeing their whole arm mirrored to make it look like they have their two arms again. By clenching their remaining hand or moving it around, and then imagining they’re doing that with their missing hand, they may feel relief from the pain. This is an example of how the brain may work at relieving pain.