I once had horrible posture. Standing six foot three is was easy for me to slouch forward. two things made all the difference. I started Fencing. Slouching forward when sword fighting is a good way to get learn the spanish term “KIssing the button” Or, getting poked in the head. I found people poking me with a metal stick really helped my focus on posture. The second thing I did. I started dating a six foot tall woman. When we were out together I would notice when I slouched and would correct myself.
So to recap.
Have people poke you in the head with metal sticks till your posture improves, and date a tall person.
Or, just find other ways to make yourself aware of your posture, over time, you will start falling into proper posture without realizing it.