The most important aspect of maintaining good posture when standing or seated is to keep the body aligned. This means keeping the spine neutral and aligning the ears, hips and shoulders. Try to resist letting your head tilt forward (this can be facilitated by putting your screen at eye level; the NHS advise keeping your screen an arm's length away from your face), and aim to keep your shoulders pulled back, retracting the scapula. If possible, a lumbar support is a great tool to help keep your upper back straight and posture robust.
What about my arms?
Your chair should be positioned at such a height relative to the desk that allows you to use the keyboard whilst keeping your forearms flat and parallel to the ground. By keeping your elbows pulled back and tucked into your ribcage, the arms should form an L-shape. This posture is said to aid in the prevention of repetitive strain injuries. When using a mouse, keep it close to your body and try to have as straight a wrist as possible, avoiding awkward bends.
And my lower body?
Maintaining a neutral posture means keeping your body balanced. Therefore, you should avoid crossing your legs unevenly for prolonged periods of time. Both feet should be planted flat on the floor, and your knees should be kept slightly lower than the hips. Some recommend shifting forward to the front edge of the chair intermittently (keeping a straight back), in order to give your body a break from its regular position. Keeping the pelvis pushed gently forward helps enlarge the lumbar curve which aids in pulling the shoulders back, reducing the risk of neck pain.
Away from the desk
It is advised that you take regular 'movement breaks' whilst working, such as walking around the room to increase circulation, or stretching overhead and linking arms behind your back to open up your chest to prevent slouching and stiffness. But when you're not in the library or the office, there are a number of activities you can practice which will help your posture while you work. The most prominent example is yoga, which has numerous benefits for your body's suppleness, structural balance, and overall wellbeing. But simple walking is great for your body too - walking strengthens the muscles that support your spine, i.e., the trunk, core and lumbar, and also increases flexibility in the lower back. Outside of physical exercises, two remedies that are said to reduce body stiffness are warm baths and massages. So if you don't want to do anything after a long day at work, run a nice bath, maybe pour a glass of wine, and soak it all in.