I keep most of my books. I now have a technical library of several thousand books acquired over half a century of doing math, programming, and CS. I remember where to find things in books better than online since the online territory shifts constantly. So, if I'm looking for a "modern" quicksort I use Sedgwick and if I want to review Prim's algorithm I use Cormin, et. al. Books are easier to read and carry around the house. Books are quicker to skim though than YouTube videos. I can see my old margin notes in books. Even mundane books, like my Assembly Language reference for the CDC 6600 mainframe, can come in handy many years later. I recall pulling it out and looking at it's unique ASM language just a couple of year ago for some idea I had.
I've programmed in somewhere between 40 and 100 programming languages. Some, I've lost track of because I didn't keep my books, but when HN has an active thread on Prolog I can go back and look at the half dozen books on Prolog programming I've got.
The younger me didn't realize how I might want to review the now classic IBM 360 Principles of Operation manual many years later; sadly, there a lot of books I wished I had kept but didn't.
Keep reading. I'm currently working through An Invitation to Applied Category Theory by Fong and Spivak.
Take classes. I found that taking real university courses really help me refresh things I learned years ago. Some are available online, but I am lucky enough to have a world class university here in town where I have taken maybe six courses over the years, usually just one or two per year. I'm able to register there for real math and CS classes at the undergrad and graduate level and these have been great experiences. Not everyone will be able to do this, but there are online alternatives. There is a big disadvantage though, universities expect the students to conform to their schedule. So forget about taking a trip to Europe with your partner in the middle of a semester. One can generally only take a university class in person if you have complete control over your own schedule (i.e. self-employed or semi-retired).
Become a member of the ACM and at a minimum read the monthly Communications of the ACM. The unique value of the ACM for me is access to their Digital Library of every past ACM article published. Want to read Dijkstra's famous "Go To Considered Harmful"? It's in the Digital Library.
Do personal projects. Solve the "Bomb Lab", for example. Write programs to generate mazes, there is a book for this. Implement a ray-tracer, there is a book for that too. Write a compiler for Pascal (many books for this) in Common Lisp. Write a program to play Othello. Write a 2D game using Open GL. Some of these can be a bit daunting, but I find writing programs are the best way to learn new programming languages. Some of this will depend on your background.
Learn Python. Many programmers will already know Python, but if not, it's very easy to pick up. It's perfect for one-person projects: easy to get into, concise and expressive. When a project needs better performance try go. It's also easy to get into and is a great programming language for typical professional systems work. These two languages will allow you to stay relevant and to do a wide variety of personal projects.
Get a big monitor. It's much easier on my eyes to have a large monitor sitting farther away from me than a laptop sitting close to me.
Exercise seems to keep my mind sharp. In my late 50s I did marathons. This was hard on my body so I might recommend half-marathons as reasonable goals. Now, I've switched to swimming (I don't really like it as much as running, but it is easier on my knees).