You can get by without having a skill in project management; I know plenty of devs who are content focusing on spec implementation. However, if you have any ambitions to be the lead on an epic or project, you'll need to have the skill. This applies to both solo development (freelance, contract) and collaborative team situations.
There's a bunch of books and courses online that can help you with the basics of PM. Once you have the fundamentals understood, the best study guide IMO is practice, practice, and more practice.
I can't speak for other PMs, but for me, elevating to the role forced me to "take ownership" of the codebase, and resulted in me having significantly greater understanding of the codebase. This in turn allows me to more quickly traverse the codebase when debugging, understand implications from changes, etc.
A silly question. How can i practice without an opportunity.
Therefore, we should try whenever we can have an opportunity
Keep in mind, Project Management is nothing more than taking a larger task, breaking it down into smaller pieces, and then keeping track of each part's progress so you're aware of the project's progress as a whole.
As far as opportunity: You'll have to create some for yourself until others offer you the chance. Start with a personal project - doesn't even have to be related to development. If your project was painting a house, you could break the project as a whole into individual tasks for each room. You could then assess the project as a whole by the current progress of each individual task.
For development projects: When in doubt, create yourself a portfolio/resume. Build a website using your skills to showcase your skills. Think about how you want to market yourself, then divide and conquer.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.