To avoid having bad posture, it is better to make sure that you are working towards good sitting posture and also priotize exercises. You need to be taking breaks at some interval in order to make it easier for you to get it done. Make sure that you are as well not taking make than tasks that you can handle. If a task demand you sit for a long time, you can reject such a task. What other ways do you think about?