

The question is, if this is correlation or causation. Maybe some people just do less things, that make them happy as they age? Doesn’t mean that you are gonna be unhappy.
Also, this is an average and I imagine, that there is a very high variance among different people. A lot of people may very well get progressively, happier as they age.
I would say, that happiness comes very much down to how you live your life, how you view the world and what you do.
If you have a job, that makes you happy and good relationships and stuff like that, you are probably gonna be happy regardless of your age.
I think that you have a lot of agency over how you live your life and what you do, which has a huge impact on your happiness.
There is no general answer here, just try to do more things that you know are good for you and make you happy. Eat healthier, stay reasonably fit, get a good and consistent sleep cycle (this has a huge hormonal impact on your happiness). Enjoy good art, make meaningful connections, if you are angry about the state of the world, try to revolt.