Compression is usually explained as automatic volume control, which is accurate and almost entirely unhelpful. The useful way to think about it on a vocal is as a device that changes the shape of every syllable in time: how fast it arrives, how long it sustains, and how quickly it gets out of the way of the next one.
Threshold and ratio decide how much, attack and release decide what it sounds like
Threshold and ratio between them determine the amount of gain reduction. They are the easy controls, and they are the ones most people spend their time on. But two settings that produce identical gain reduction meters can sound completely different depending on attack and release, and those are the controls that determine whether the result sounds like the singer or like a device.
A fast attack catches the consonant at the front of a word. This tames plosives and sibilance, and it also removes the sound of the singer starting the note — which is a large part of how a voice communicates effort. A slower attack lets the transient through before the gain reduction arrives, keeping the front of the word intact and compressing the sustained part behind it. On most vocals, the second is what you want, and the difference between them is measured in a few milliseconds.
Release is where compression becomes musical or mechanical
Release determines how quickly gain comes back after a loud passage. Too fast and you hear the level moving inside a held note, which reads as pumping or as a strange breathing quality behind the voice. Too slow and the compressor never lets go, so quiet phrases that follow loud ones are pushed down along with them and the performance loses its dynamics entirely.
The setting that works is usually tied to the tempo of the song. If the release is roughly matched to the gaps between phrases, the gain reduction moves with the music instead of against it. This is why the same compressor setting rarely transfers between two songs at different tempos.
Two compressors, small amounts each
A common professional approach is not one compressor doing eight decibels of work but two doing three or four each, with different characters and different jobs. The first, with a slower attack and a moderate ratio, evens out the phrase-to-phrase level. The second, faster and gentler, catches the peaks that get through.
This works because compressors sound increasingly like themselves as they work harder. Two units lightly engaged stay closer to transparent than one unit fighting. It also lets each stage do one thing, which makes the whole chain easier to adjust when the mix changes around it.
Do the automation first
Compression handles the small, fast dynamics inside a phrase. It is poor at handling the slow ones — a verse that is generally quiet, a bridge where the singer backs off, a single word that got lost. Those are level problems across seconds, and a compressor asked to fix them has to work so hard that it audibly changes the tone.
Riding the fader first, or writing automation to bring phrases into a consistent range, means the compressor only has to deal with what it is good at. The counterintuitive result is that a vocal with careful automation usually needs less compression and ends up sounding more compressed in the good sense: present, steady, close.
Sibilance is a separate problem
A compressor set fast enough to control an aggressive "s" will also flatten every consonant in the performance. De-essing exists because sibilance lives in a narrow frequency band and a short window of time, and treating it there costs far less than treating it broadband. Put the de-esser before the main compressor if the sibilance is driving the gain reduction; put it after if the compressor itself is bringing the sibilance up.
Listen to what it removes
The most useful habit with any compressor is to listen to the difference rather than the result. Many units offer a way to monitor the gain reduction signal directly; where that is not available, flipping the compressor in and out at matched level does the same job less precisely.
If the removed signal contains breaths, the front of words, and the sense of the singer pushing, the settings are taking something the song needs. If it contains a few loud peaks and some room tone rising between phrases, it is doing its job.
Match the level before you judge
Compression raises the average level, which makes a compressed vocal sound better than an uncompressed one for reasons that have nothing to do with compression. Any comparison that does not match the perceived loudness of the two states is not a comparison. Turn the output down until the two are equally loud, then decide. Often the answer changes.