You need to be in Versus mode. That is the mode where players split into a survivor team and an infected team, and it is the only place you control the special infected.
From the main menu, choose Versus, then either host a lobby or join one, and the game assigns sides. Playing infected is a genuinely different experience: you spawn as Boomer, Hunter, Smoker, Spitter, Jockey, Charger or Tank, each with a distinct role in breaking up the survivors' formation rather than simply killing them.
Scavenge mode is sometimes suggested as an alternative, but it is a competitive survivor mode with a collection objective and no infected player control. If your goal is to play the monsters, Versus is the answer.