Instructions
Team Colors
Start "Team Fortress 2" and join a multiplayer game.
Click on the red or blue door on the first screen that appears to determine which team to join. Choose a class to play as on the next screen.
Press the "Period" button on your keyboard while in game to return to the team color selection screen.
Hat Colors
Obtain a paint can. These can be found from the game's random item drop system while you play, either as a single paint can or contained within a crate. Specific paints can also be purchased from the Mann Co. Store.
Click the "Character Setup" option on the game's main menu, and then click the "Backpack" option.
Scroll through the items in your backpack until you find the paint can you want to use. Click on the paint can item and then click the "Use With..." option at the bottom of the screen.
Click on a hat in your backpack that has not been greyed out. Press the "Yep, I'm Sure" button when it appears to change the color of your hat.