I was at a conference once where this was discussed. The general feeling was that one must decide to actively do things in order to be happy and to live longer. One suggestion was to look back to your earlier life hobbies and see if you wanted to take one or more of them up again. Another view was learn a language, or revise a foreign language that one once had a smattering or more of. You can also look for and join a local club, whether active (like walking together) or quiet (like a book group). If one has a transmittable skill then see if you can teach others, probably free via some local organisation or other. And finally, as I remember it, it is excellent to volunteer for something, like helping in your local library or charity shop.
Someone once pointed out that volunteering is so good for you one would think the government would make it compulsory...
Few if any felt that going back to paid work in your old job was a great idea, unless one desperately needed the money. Non-paid work usually involved new people and places and this was beneficial and a much better bet.
Me, when I retired I taught computing skills for free for an aged charity, and also relearned French and Chinese which I had done years earlier. In the end and after several years I gave up on all of these. Too old and tired to travel to teach the skills and I finally discovered that with the languages what I learned one day had kind of disappeared the day after, so I stopped the language stuff then. This was maybe two or three years later.
I also joined a book group which made me read a book a month that I otherwise would probably not have found and then enter into the somewhat boozy discussion session about it. I tried to take a walk each day which worked well but eventually it got down to one or two days a week, owing to health problems and my aversion to getting wet when it rained.
Hope that helps.