In A Hat in Time, you need to enable co-op in the pause menu.
For example, in Enter the Gungeon, you need to talk to the purple cultist in the hub to enable co-op. Some games will require you to do additional steps in order to split the controls. If co-op controls aren't working and everyone is controlling player 1 in the game, check each of the reasons below.