Product management is a relatively new field, and as such, there is no one set path to becoming a product manager. Many product managers come from diverse backgrounds, including engineering, marketing, design, and business.
That said, there are a few things you can do to increase your chances of landing a product management role, even if you don't have prior experience as a PM.
Understand what product management is and what product managers do. A good place to start is the book "The Lean Product Playbook" by Dan Olsen.
Talk to as many product managers as you can. Ask them about their career paths, what they love and hate about their job, and what skills they think are essential for success in the role.
Get involved with product development in some way. This could mean working on a side project, participating in a design sprint, or simply taking on more responsibility at your current job.
Read articles and books about product management. In addition to "The Lean Product Playbook," other recommended reads include "The Innovator's Dilemma" by Clayton Christensen and "ReWork" by Jason Fried and David Heinemeier Hansson.
Consider pursuing a formal education in product management. There are now a handful of institutions, including UC Berkeley and the University of Washington, that offer graduate-level programs in product management.