How to check how many players are currently connected

I want to know how to make my game check for how many players are currently playing by checking how many controllers are currently plugged into the machine. It’s a local player game.

The idea I had was for player would be put into the game by pressing A on their controller, but I’m not too sure how to go around this. Any advice would be greatly appreciated.