Anki for practicing recall and a lot of practice. Tons of daily practice. Build as many things as you can. Build for fun. Build to use the tools given by the language. Build unoptimized slop to experience first hand why it’s normally not done.
I rely on Anki heavily so that the book content sticks around in my head. Do it long enough and you’ll be able to recall entire books bit by bit.
Identify the gaps in your knowledge and plug em with books and courses. Reading books without practicing recall and working on your own projects might be a waste of time. I personally don’t think it is if it’s fun.
If you review something every day you are more likely to remember it every day. Whatever I’ve actively recalled for an extended period is up there tumbling around the mind.