re: how to and why
Do some looking on suspension sites, as mx-tech and such. There have been rather extensive write-ups (quite similar to the above) on what to do and why to do it. Repeating it all here is rather non-productive.
***edit***
Go here, search for <suspension>, find a bunch of sites:
http://www.motolinks.com/default.asp?a=PitStuff
****edit****
A couple of short answers: Rebound and compression are setup according to rider and conditions. They will change from time to time, for example, a good rule of thumb is add a couple clicks for starters if you're going to the dunes (sand).
Don't mess with the nitrogen canister. That is setup pressure-wise by whomever rebuilds your shock on your annual maintenance duties...not likely you.
The adjustment on the top of the shock is compression; rebound on the bottom. Note where they are (number of clicks out), then adjust them all over the place, bounce your bike around to see the range of effect you can get (no point to that...maybe just interesting).
BTW...re: the above. You don't use the hammer/drift-punch to set the spring retainer ring, but to loosen the LOCKING ring. To move the retaining ring (the one touching the spring) turn the SPRING, which will in turn move the ring. It will help to spray the spring with at least some water. Soapy water is better. Use a pair of gloves when you turn the spring.. with no weight on the suspension of course. Don't forget to tighten the lockring after you're done.
A couple of basics on shock compression/rebound. Set the compression such that it fully absorbs impacts..does not kick your butt cuz it's too slow in responding (too stiff). Set the rebound such that it doesn't 'pack'. There should be no 'additive' action on successive bumps. The shock needs to be uncompressed from the last bump before it gets smacked with another. The 'additive' action is 'packing'.
Rebound should be SLOW enough that it doesn't kick your butt (and maybe the rear wheel in the process) on its way back out, fast enough that it's set for the next bump.
An example of when you need to change something. You stall/stop for whatever reason on a fairly steep uphill. Your front wheel has an obstacle you can't get over..can't pop over it cuz you'll loop it.
You may find that a click or two LESS compression on the shock (allows the rear to 'squat' more) and one or two less compression on your forks would allow you to just 'get over it'.
A click or two can make big differences in how your bike works.
As EG says, if it's 95% rider and 5% bike, you'd better make that 5%
COUNT!!