Yoga is by FAR the most effective tool I know to correct postural issues - if done correctly. This is why I stress correct alignment during yoga.
Good posture is related to less pain, better circulation, better digestion, more energy, better mood, and makes you look and feel confident and assertive, and can even make you appear thinner.
A lot of modern yoga and exercise classes perpetuate bad posture so be careful with which classes you do and who you choose as your teacher.
Once you have learnt good posture, and alignment techniques during yoga, your body will remember it so you don't have to think about it so much. Then, the practice becomes more and more internalised. But until then, learn about good posture and you will benefit so much.
I will do more posture posts this week and teach you the correct way to stand and sit, if you do either of those things for long periods of time, you know how painful it can become so I'll teach you to alleviate some of that pain.
Have a lovely day!