Bots in Team Fortress 2 are AI-controlled characters that mimic human players, making them great for practice. Here's how to set them up:
First, from the main menu, click the "+" button next to "Browse Servers" to create your own server, then pick a map. For the smoothest experience, choose a CP, KOTH, PL, or PLR map rather than Arena or MvM.
Next, open the developer console and type sv_cheats 1 (it's off by default), then nav_generate to build the bots' navigation paths. The server will restart itself. Once you're in, pick a team and class.
Finally, reopen the console and type tf_bot_add x, where x is the number of bots you want to add.