I'm going to give you a few different scenarios in which I would use compression. Explain roughly how I would set the compressor, and why those settings will achieve the desired result. Keep in mind, I typically use compression as transparently as possible. These suggestions won't help you much if you want to use it otherwise.
1) Individual track is too quiet on the softer parts of the song, but is just right in the louder parts of the song. Goal: Bring up the soft parts to appropriate volume.
a) Find the average volume of the track during those quiet parts (Do this with the compressor off please). Set the threshold somewhere just above that level, so basically, the soft part of the song won't be compressed. Afterall, the whole point is to make that part louder, right?
***Here's a great tip on checking yourself. Turn the compressor's ratio to it's highest setting. Playback that soft part of the song in its entirety. If you see even the slighest amount of gain reduction, you need to raise the threshold. Raise it 1 db at a time until the compressor is no longer doing anything during that part of the song.
b) Use lower ratio. Likely around 1.5:1. To set this, consider two things. You have to know about how many db you are hoping to raise the volume of the soft parts of the song. Essentially, you want to see that amount of gain reduction during the loud parts of the song. To make the soft part 3 db louder, the loud part must be reduced by 3 db due to the compressor. The other thing, remember that the higher the gain reduction, the more likely it is to sound compressed, which probably isn't a good thing.
c) Fast attack.
d) Long release.
e) Set Make-up gain to match highest amount of gain reduction during the loud part of the song.
2) You need an entire track to be louder, but there are some nasty volume spikes that cause the track to clip out briefly, even though the track overall is still not loud enough in the mix. Any louder, and the clipping gets worse.
a) Set attack very fast. Possibly as fast as it can get.
b) Probably a medium ratio, say around 3.0:1
c) Identify loudest peak in song. Set threshold so you get enough gain reduction to raise the overall track volume to optimum levels, with no clipping.
3) Kick and snare are fighting in the mix. The drums sound great by themselves, and even with the guitars/vocals/keys are added... but once the bass gets added in. The kick disappears in the mix. Let it be said however, that the bass is not simply too loud, it's where it needs to be, but the kick just falls short once the bass starts playing. Let the sidechain brief tutorial begin...
a) Place a compressor on the bass track. Use the sidechain feature to sidechain the kick's input signal into the bass compressor.
b) Set a pretty fast attack.
c) Set the release medium-fast, as you don't want it to totally crush the bass volume, just merely to open a little pocket for the kick.
d) Use a lower ratio, like 1.5:1 or 2:1. Go to the part of the song where the bass overshadows the kick the most. Adjust Threshold to get maybe around 1-3 db gain reduction.
***What you have achieved here is simple, once the kick hits, the bass volume quickly drops a few db, then pretty quickly goes right back to where it was. Since the kicks' is a punchy, quick attack instrument, it only needs that pocket to open up in the bass for a very brief amount of time. If it's open longer, you're no longer leaving room for the kick. You're simply just killing the bass volume after the fact.