It's very clear from looking at chess, but also e.g. online gaming and sports that people in their 20s have the strongest cognitive capabilities, especially "processing speed".
But on the other hand, the world is very complicated and you can't know much in your 20s. I'm today a much better programmer than 10 years ago, even with slightly less brains. You are not going to write an impactfull novel without live experience.
How that declines varies and some people still have most cognitive capabilities in their 70s.