Pilot Pete is right:
First you have to be lucky. The airline you're in must be doing upgrades to captain, and your number (seniority) must be up at that time.
Only then, you can start the training to command.
In that training, it'll become quickly clear if you have the abilities to actually become a captain.
Good luck to all of you, and pray nobody chooses to fly another aircraft into some large buildings again, or the road to command could become much longer...