If co-op controls aren't working and everyone is controlling player 1 in the game, check each of the reasons below.
Multiplayer needs to be enabled
Some games will require you to do additional steps in order to split the controls. For example, in Enter the Gungeon, you need to talk to the purple cultist in the hub to enable co-op. In A Hat in Time, you need to enable co-op in the pause menu.
Keep in mind that your game needs to actually have a split-screen mode implemented. Search online if you're unsure about whether your game has this, and how to enable it.
If you're using an emulator, you also need to make sure you haven't mapped everyone's controllers to the first slot in the emulator settings. Everyone must be on a unique slot for them to be seen separately by the game.
Multiple players are using keyboard and mouse
Unlike controllers, all keyboards and mouses are seen as one. This is because Windows and the game has no way to tell which keyboard and mouse belongs to who.
Some games (such as Overcooked) allow the use of different keys for each player (e.g. player 1 uses WASD, player 2 uses arrows), but you can only get as many separate keys as the game allows (for Overcooked, only 2 people can use the keyboard). Check the settings for your game to see if it allows for it. The rest of the players will need to use a controller.
If you don't have a controller, you can also check how to emulate a controller using the keyboard.
Players are using keyboards and controllers
The way games behave when one player is using keyboard and mouse, and others are on a controller depends on how the game was programmed. For example, in a lot of games like Cuphead, the person on keyboard must start the game and join the save file first, in order for the game to let the controller be a separate player.
Some games like Dragon Ball FighterZ will not split the players under any circumstances, because it just wasn't programmed to do so. You need to have everyone using controllers, or have a dummy controller to stay along with the keyboard player.