With the current COVID 19 situation where many people are working from home, a common complaint that I am hearing is that many peoples posture has suffered. This has resulted in neck pain, low back pain, headaches and shoulder pain to name a few. While its difficult to have the "perfect" setup at home, you can make some simple modification to your work habits/ergonomics that may help relief some of your pain and discomfort.
Take breaks. This seems like a no brainer but consider the difference of working at home vs the office. Odds are you arent getting up to talk to coworkers, walking for your coffee break, or going from meeting to meeting. Its been a common trend that working from home means moving less. Take those short breaks in your day to get up and move, stretch or go for a walk.
Ergonomics. Your work station was likely set up with your ergonomics in mind. Having the screen, chair, keyboard, etc a proper height and distance. This was all factored in to decrease the possible strain you might be putting on your body as you work. Consider what you can use at your work station so that everything is in a comfortable range and so that you are able to use everything in a comfortable upright position. Prop your screen up on something, don't sit slumped on your couch, and use a mouse if you can. These are just a few things to consider when looking at your ergonomics.
STRETCH. No one is meant to sit in a prolonged posture for 8 hours a day without movement. Your muscles get fatigued and cannot keep engaging the entire day. Stretching for 10-30 seconds every 30 minutes to an hour will help you sit longer with better posture.
Workout regularly. Strengthen the right muscles when you can so that they have a better chance of maintaining better posture when you need them. Pay attention to the upper back mucsles which include the rhomboids and mid trapezius muscles between your shoulder blades, as well as your core (abdominal) muscles. These muscles play major roles in helping you maintain "good" posture. Other muscles should also be considered including the deep neck flexors, the glute muscles, etc.
Physical Therapy. Chiropractic, RMT, and Physiotherapy can all assist in postural correction. Through treatment, rehab exercises/stretches, advice on how to modify how you work.
There are many other factors that may be unique to your current situation affecting your posture. Some factors will be things that you can change and then there will be some factors that your cant. Focus on the things that you can change and make the the appropriate adjustments to better your posture and wellbeing.