Not only does it work, fixing your posture will both convey to others and help you to feel more confident, no other mental tricks required. I've known this since I was in grade school.
https://www.axios.com/2023/03/23/good-posture-confidence-sit-up-straight