There are tons of articles on the web that will help much more than I can in a single post, and I'm far from an expert on recording, but there are few "tricks" I've learned just by dicking around with compressor plugins. Some may be "wrong" or whatever, but most of the techniques I use I either learned by accident or after tons of trial and error.
At the risk of sounding like a total idiot, I'm going to try to explain things in layman's terms, because I'm a layman. Anyone with more knowledge feel free to correct me if I'm wrong on anything. Also sorry if I explain stuff you already know.
A compressor is basically like a robot with a hand on a volume fader. When the volume level goes over a certain amount (the threshold), it pulls the fader back. The attack time determines it's "reaction time" if you will. A really fast attack time will make the compressor pull the volume down almost instantly, whereas a slower attack time will have it wait a while before doing anything.
The Threshold is simply the level where the compressor actually reacts. If the audio signal never reaches the threshold, the compressor won't do a damn thing. Once the audio crosses over the threshold though, thats when the compressor reacts, by pulling the volume down by the amount determined by your ratio setting.
I'm probably not the best person to explain the whole ratio thing as I prefer to use my ears to set it and never really pay attention to what the setting actually is

ill

but it basically just determines how much volume the compressor cuts in relation to how much the signal overshoots the threshold. Basically the higher the ratio the more drastic the attenuation.
The release time simply determines how long the compressor continues to hold the volume back after the signal drops back down below the threshold. The longer the release time, the slower the compressor is to return the "fader" back to its original position. The faster the release time, the quicker it ends its attenuation.
So it's like you have your robot sitting there with his robot hand on the fader, and you tell him how quickly you want him to react (attack time) whenever the volume passes a certain level (threshold), and how far down you want him to pull the fader for every db above the threshold that the signal reaches (ratio). You also tell him how long to wait before returning the fader to it's original position (release time). Also normally after all that volume cutting you'll have some sort of "makeup gain" or output volume to bring the overall volume back up or beyond where it was to make up for all the cutting the compressor did.
Compressors can be used as a utility effect, like wrangling in overly dynamic sources and evening them out, to make things sound louder, and also as a sort of coloration effect. One very useful "trick" with a compressor is dampening unwanted ring from a snare drum, for example. I once recorded a drummer with a disgustingly ringy snare, but I was able to use a compressor to kill the ring a bit by using a moderately slow attack time, which let the inital attack of the snare through before slamming down on the decay of the drum, thereby saving what would have been a really funky snare track. I should have made him retune the snare, but whatever. Too late. The compressor saved me.
One thing I have found and adopted as a sort of personal habit with compression, is to use somewhat slower attack times with percussive elements, so the initial transient can come through to provide some punch, and faster attack times on less percussive instruments (bass and vocals), to keep everything pretty smooth. Release times pretty much depend on the track. I rarely if ever put compression on guitars, because once you add all that gain (assuming we're working with distorted guitars), you're already killing the dynamics. Palm mutes can occasionally cause some problems, but for me subtractive EQ helps smooth things out in a more pleasant way than compression.
Also remember that like anything else, your settings will depend on what you're compressing. There are no magic formulas. Different snares, different drummers, and different tempos for example will all effect how you may want to set the compressor pn your snare track. So you really just have to mess with things and use your ears.
Try some extreme settings to play around with and experiment with the attack and release times just to get a feel for what they do. It will more than likely sound like garbage, but it help you learn as it will be easier to hear what's going on.
Hope that helps a bit.