The circular problem in most careers is that leadership roles go to people with leadership experience, and leadership experience requires a leadership role. The way out is recognising that most of what makes someone a good lead is practised without authority, and is visible long before any title changes.
Take responsibility for outcomes, not tasks
The clearest marker of someone ready to lead is that they own whether something works, not just whether they did their part. If a project is drifting and your piece is finished, the leadership behaviour is to flag it, not to note that your bit is done.
This is uncomfortable because it means being associated with failures that are not strictly yours. That association is precisely what gets you trusted with more.
Learn to run a decision
Most teams are slowed by unmade decisions rather than wrong ones. Being the person who notices a decision is stuck, gathers the two or three options, names the trade-offs and pushes for a choice is enormously valuable and requires no authority.
You do not need to be the one who decides. You need to be the one who makes deciding possible.
Get good at explaining things
A large part of leadership is translation: explaining technical constraints to non-technical people, explaining business pressure to a delivery team, explaining a decision so people can act on it.
Practise by writing summaries nobody asked for. A short, clear note after a messy meeting that states what was decided and what happens next will make you visible faster than almost anything else.
Give feedback well before you have to
Feedback is the skill new managers most often lack, and it can be practised as a peer. Specific, timely, focused on the work rather than the person, and delivered privately.
Equally, learn to receive it without defensiveness. People notice who can hear a criticism and act on it, and they draw conclusions about how that person will behave with more power.
Support people without being asked
Helping a new colleague find their footing, answering questions patiently, sharing something you worked out rather than hoarding it. These are small and they are also the entire substance of the job.
Managers watching for potential leads look at whether people voluntarily go to you. That is a signal you cannot fake.
Handle disagreement in public well
How you behave when you are wrong, or when someone challenges you in front of others, is watched closely. Conceding a good point gracefully raises your standing. Defending a weak position because you already stated it lowers it.
Volunteer for the unglamorous coordination
Running the standing meeting, writing the process doc, chasing the dependency nobody owns. This work is invisible when done and painful when absent, and it is the closest available proxy for management.
It is also how you learn whether you actually want the job, which is worth knowing before you take it.
Ask for the responsibility explicitly
Having practised these things, say what you want. Tell your manager you would like to lead the next project, or mentor the next joiner. Most managers are relieved to hand this over and simply have not thought to ask.