Activation of cheats for Call Of Duty Modern Warfare 2 requires editing of game's config.cfg file because there is no option in the game to enable/activate cheats.
First locate you installation folder (usually C:/Program Files/Activision/Modern Warfare 2/). Inside you'll find players folder which contains config.cfg (if there is no such a file, you'll have to start game and exit as soon as the first level starts. This will create configuration file). Use WordPad (start/programs/accessories/WordPad) to open config.cfg and add this line to the end of file: seta thereisacow "1337"
Now cheats are activated but since there is no way to enter codes while in game, you'll have to bind each cheat to different key of your choice. Each binding requires additional line in config.cfg. For example these lines will bind p key to immortality and m to infinite ammo:
bind p "god"
bind m "give ammo"
Full list of commands which can be bind to keys:
god - god mode (immortality)
give ammo - infinite ammo
notarget - disables AI (enemies ignores you)
noclip - no clipping (go through walls)
timescale [value] - sets game speed. For example if you want to run game at 50% of full speed, enter 0.5 (default value is 1, which means 100%).
devmap [map name] - use this to switch among these maps (levels): trainer, roadkill, cliffhanger, airport, favela, invasion, favela_escape, arcadia, oilrig, gulag, dcburning, contingency, dcemp, dc_whitehouse, estate, boneyard, af_caves, af_chase