The #1 thing that helped me was sitting forward, on the edge of the chair, with legs tucked in, and removing the arm rests so my arms hang down naturally. A lot of people say it's unnatural, therefore, unhealthy, for humans to sit for 8 hours a day, but that's not entirely true. Humans have been riding horses and camels since practically the dawn of history, sometimes for >8 hours a day, weeks at a time, however these animals do not have arm rests or back rests.
The #2 thing was getting ergonomic equipment. Most office equipment is not designed for ergonomics, but economics. For a keyboard, I highly recommend the Kinesis Advantage2. The scooped design conforms naturally to the curves of the human hand. Though you have to relearn typing to an extent, it's totally worth it. You will also need an adjustable height external monitor. If you don't want to pay, don't be shy to ask your employer. It's an investment that pays off big in your efficiency.
The #3 thing was doing wall slides. https://www.youtube.com/watch?v=yOtlRQxwt3g This doesn't help with the pain, but it is the only exercise I've ever tried that corrects kyphotic posture. Immediately after I started doing them, friends and family were asking me if I've gotten taller. It activates muscles in the upper back that I didn't even know existed.