I’ve had bad posture since I was a kid (40s now). I gave up until a few years ago because all I ever heard or read was “stop slouching”. So, when I did try to have good posture, I’d end up just puffing my chest out which never felt like something I could sustain. Finally, I randomly came across “chi running”. I never took up running but watching their videos it finally clicked how to actually get myself into a good standing posture: (1) push the crown of your head to the sky as if being pulled by a string (2) engage your core so that your pelvis is level. The core+pelvis part is key for sustaining good back and neck posture. I realized I never engaged my core when sitting or standing. See https://youtu.be/N8VXrv2KVeE?t=95 .
As far as sitting posture, I keep this picture at my desk to re-evaluate my posture https://1-hp.org/wp-content/uploads/2025/04/ergonomics-101.p...
Specifically to try to combat the effects of having forward head posture for decades, I do the chin tuck exercise - see https://www.youtube.com/watch?v=09kHVqOx1Hs&t=25s - from the McKenzie method for neck pain/injury prevention (book https://mckenziemethod.com/product/mckenzie-method-treat-you...)