C4 is a manually triggered explosive device. They can be thrown anywhere - ground, walls, cars, etc. Once planted you are then equipped with a detonator, allowing you to detonate the bomb at the right time.
 Modern Warfare
In Modern Warfare, C4 is a perk in slot one. To use a C4 device, first select it in PERK 1. Once selected, press left on the direction pad, and then R1 (Right Trigger) to plant. R1 (Right Trigger) is also used to detonate the C4 once equipped with the detonator.
 Modern Warfare 2
In Modern Warfare 2, C4 is treated as a grenade, so it replaces frags, Semtex and claymores. It is deployed using R2 (Right Bumper) and then detonated with the fire button.
 Black Ops
In Black Ops, C4 is classed as Equipment. It is deployed using up on the D-pad, and then detonated with the right trigger.
Related ThreadsShould they fix C4 and Glass? - last post by @ Feb 22, 2010
How the heck do you use C4s effectively? - last post by @ Mar 31, 2008
Questions about C4 - last post by @ Jan 18, 2010
Wreckage C4 - last post by @ Jul 27, 2011
Cool Claymore + C4 Trick - last post by @ Feb 25, 2010