Why does posture matter?
Your spine has natural curves built into it. A slight backwards curve in the neck and low back and a slight forward curve in your midback. These curves are the way that your bones are shaped and help to balance the stresses on your body. The amount of work that your muscles have to do to hold you upright is influenced by these curves.
How poor posture affects your muscles
Hold something that has a bit of weight in your arms. If you have a 10 pound weight, try using that. Bring it under your chin and feel how heavy it feels. Now hold it at the same level with your elbows straighter and further in front of you. Can you feel how much harder your muscles have to work the further in front of you the weight gets?
Your head weighs about 10 pounds. When you slouch your head moves forward. This causes your back muscles to work harder to hold your head upright. Some of these muscles are in your neck and shoulders but others attach into your low back. If this continues to happen, over time these muscles can start creating localized pain or can refer to other areas of your body including your low back, shoulders and arms.
More than muscles can become involved
Continued poor posture can lead to stiffening of your spinal joints. Over time some of these postural support muscles become lengthened and weakened and others become shortened and tightened. The longer you've had these changes the more work it takes to reverse them.
Posture check part 1
If you've had poor posture for a long time, you may not be aware of where neutral is. Our sense of where our body is in space (referred to as proprioception) can become distorted with poor posture and injuries. Try the steps in the video below to see if you can retrain where neutral should be.
I wasn't able to achieve the right posture position

Yes, but that was hard.
If you were able to get into your correct posture then the next step is often correcting your posture frequently during the day. The video below shows one way to get you recognizing where neutral posture is without a wall.