Slouching postures could contribute to pain in upper shoulder muscles due to shoulder muscles constantly trying to balance protruding head on top of the spine.
Focusing on squeezing shoulder blades backwards and down can help straighten out thorax and balance the head on top of the spine in more neutral position reducing head forward posture and reducing unnecessary stress put on the shoulder muscles by the slouching posture and protruding head.
Note: These blog posts are general ideas that I find could help people to cope with their daily aches and pains and muscle tension they are experiencing in their daily lives. Keep in mind that it is best to get a proper physical exam assessment with a therapist in order to meet your personal health goals. If you are seeking a diagnosis of an issue it’s best to see a medical doctor.