Yes, absolutely. It does not take too much effort, either.
People who say you need adjust your posture are mostly incorrect. Your body will assume a slouching position after a while no matter what. You cannot consciously will yourself to just "sit better". Good office chair and placing your screen at the right height do help enormously; these are things that make your body adopt a certain posture subconsciously. But they're not a complete fix.
The only real fix is to work out. Bad posture resolves itself over time if you build up strength in your muscles and tendons, all the way from your legs to your neck, the whole shebang. You can think of your body as a piece of rope. If not adequately exercised, the individual strings will start to sag and the rope goes floppy. Training tightens the whole thing into a stable, tight bundle.
You don't need to go full "gym bro" or even enjoy it. But you need to do regular strength exercises — squats, deadlifts, crunches, the usual — every week. You don't need to do super heavy lifting or intense cardio, just a healthy, generalized workout routine focused on the whole body. In theory you can do this at home. But as someone who's patently not a gym bro, the only way I was able to do this is to get a personal trainer.
I found a wonderful gym where they did small, four-person group classes. There are many of these around, and while they may be pricier than regular gym membership, they're worth it. You get a personalized program with a trainer who monitors your progress carefully and corrects your form and technique, and keeps you motivated.
I wouldn't work out on my own as I would find excuses to stay away, but by setting up a regular appointment twice a week, I kind of forced myself into it. And when you have a trainer you see twice a week, it's much harder to cancel just because you don't feel like working out that day.
Lastly: Stretches (like the classic "stand against a wall" tricks you find online) do not work, because you're just temporarily stretching muscles and tendons. These need to be actively worked out in to build up, and stretching can actually be counterproductive. This is one reason why physiotherapists typically don't recommend yoga and Pilates, which put too much emphasis on stretching rather than strength exercises.