The absolute worst managers I’ve seen (thankfully, none were my manager) only became managers because they were drawn to the power of the position. They had no other qualities that would have led to them assuming the role naturally. These people generally became managers by brownnosing their way into the role, or straight up lying about their previous work experience. Don’t do this.
So, how to become a good manager? It will happen naturally if you are an excellent IC at a place where your skills and contributions are recognized and valued. Sometimes excellent ICs are overlooked and undervalued; if that’s the case, find another team/company that actually recognizes your contributions. But most of the time, people just don’t have the skills/qualities to be manager material, and that’s fine too—there’s absolutely nothing wrong with being a lifelong IC! I know many people who were great ICs, were promoted to management as a result, hated it, and went back to being hackers.