"No slouching posture!", your parents said... "Sit up straight!". And for good reason. If you slouch, you are bound to get severe neck and back pains sooner or later. But it hurts you more than that...
In body language, slouching is associated with insecurity and lack of strength. I find it hard to explain this in words, so let's try it with a side by side comparison.
First, here's someone who slouches...
See how his back is highly curved? How the shoulders are pointing inwards? This gives the impression of someone who makes himself smaller, as if he'd rather not be there. You are signaling that you feel the other person has authority over you, is more than you.
Because of this posture, there's less room for the lungs to breath, and because the head is tilted forward, enormous stress is put on the neck. The energy in your body can't flow freely. So, it not only makes you appear less powerful... you are less powerful!
Now let's compare that too someone standing straight.
This is the complete opposite. The back is straight, the shoulders relaxed. This posture says: "I'm in control. I'm in control over my body, and over my mind."
There's no 5 minute fix for slouching. It takes exercise. If you strengthen your muscles, this will improve your posture. Emphasize on the back and shoulder muscles. Personally, I really like to exercise this on a rowing machine. Yoga and Pilates focus strongly on good posture, to make energy flow freely again.
Regular massages also helps. It loosens the muscles, that have become stiff over the years. They have adjusted to your slouching posture, and need to be freed up so they don't force you back into a bad posture.
Also, in the office, make sure you have a good chair, that can be adjusted so you sit properly. Set up your workspace so it is ergonomic (ergonomic workstation checklist),
And wherever you are, be aware of your posture! Bring your breast forward by pulling back your shoulders, and at the same time make sure they remain relaxed (don't pull them up). Pull your head up, as if a wire connected at the top is pulling it. Suck in your gut, and breath freely (feel how much easier it is to breath when standing tall).
Other people will notice your new-found confidence.