The NHS guidance[1] on this has been helpful, but I think a key factor is being aware of your posture slouching, which is where taking breaks is vital so you can re-adjust.
[1] https://www.nhs.uk/live-well/healthy-body/how-to-sit-correct...
[1] https://www.nhs.uk/live-well/healthy-body/how-to-sit-correct...