You type them in the in-game console. The console is used for entering various developer commands, including "cheats" such as noclip. You can call it up by pressing your tilde key (~). If it doesn't come up, go into TF2's keyboard options, click the "Advanced" button, and check "Enable developer console".
Once ingame, type those lines (separately) to hide your HUD and weapon. Retype them (but change the 0 to 1) to bring them back.