How to set up a compressor:
You want to know how to set the knobs on your compressor, or at least some good settings to start with. OK. Here's a very simplified starting point:
If your compressor has just two knobs, typically labeled "comp" or "sustain", and "level" or "gain", then just set both knobs at 12:00, their midpoint. Then adjust to taste. If the result is too noisy or extreme, then turn the comp/sustain knob down to a much lower setting.
If your comp has more than two knobs, make sure all non-compression functions are turned off. That includes expansion, gating, enhancing, and de-essing; and if there is a separate limiter function, turn it off too. Read the manual if it is not clear how to turn these functions off--some knobs need to be turned fully clockwise, but others need to be fully anticlockwise. Now looking at the compressor-specific functions (such as attack, release, threshold, and ratio), set all of the knobs to 12:00. This will be a reasonable starting place for most comps. Once you've got the compressor working normally, then you can experiment with the other available functions. Always keep the limiter threshold higher than the compressor threshold.
Of course you'll need to dial all of these controls in appropriately for your individual signal in order to get good results--so the real truth is that you have to learn what each of the knobs does, and how each of the functions reacts to your individual situation. All settings will be heavily dependent on the output level of your instrument, the dynamic range of your playing style, and the results you want from the compression.
Also be aware that every compressor works a bit differently from others, so you will have to learn the individual features, quirks, and limitations of whatever comp you're working with. Even if you copy specific ratio and attack settings etc., different units will not act identically due to the wide variance in components and circuit design. The reason I do not give you more specific control knob settings to try is that settings that work well for one person will not necessarily work for someone else.
Having taken all those factors into account, here is how to dig in deeper to set your controls correctly:
The very first and most important setting to consider is the level of the signal you're feeding into the compressor. Some comps have controls for input level and/or threshold, but many (especially pedals) do not. You need to have complete control over the point when your signal crosses the threshold, or else you are just gambling and hoping that the compressor was designed in a way that just happens to match your personal signal. Too often people buy a comp pedal and hate it because it squashed their signal too much, or it didn't do anything appreciable, and then they say compression sucks. But 99% of the time the problem was that their instrument signal level was not matched to the ideal operating range of the compressor. When setting input level and threshold, remember that raising the input level is the same as lowering the threshold. Also note that the threshold knob on some comps may be "backwards", so that turning it clockwise lowers the threshold, increasing the amount the signal is compressed. If your comp has no input level or threshold controls, then you have to use the volume knob on your instrument, or maybe another pedal that can boost or cut levels, in order to bring your signal into the best operating range for the comp you're using.
The next parameter to consider is the ratio. Of course the usual thinking is that a low ratio (under 5:1) is for gentle compression and a high ratio (above 10:1) is for peak limiting; but even those ideas are dependent on the threshold and the results you want. For example a low ratio and a very low threshold can result in a lot of extra sustain, while retaining fairly natural dynamics. A high ratio and a low threshold results in a super-squashed signal. The ideal setting for peak limiting would be a very high ratio and a high threshold, so that only the biggest signal peaks get touched at all, and they get capped off completely. If you want to rein in a loud/boomy low string, choose a high ratio and then set the threshold so that only those boomy notes cross the threshold and get squashed. It's all interactive with your specific instrument signal, so you have to experiment and balance all these factors together. Some comps have a fixed ratio; in that case, the only way to control the ratio is to select a comp that has the ratio you need.
Attack and release are the trickiest settings, as they are completely dependent on personal taste and playing style and expectations. A slow attack will allow more of your natural note attack though, allowing for the greatest articulation and pick/pluck crispness; but it also allows more sharp peaks (from aggro playing, boomy low notes, etc.) through at the beginning of each note, so you may need to shorten the attack in order to catch those spikes. It's a balancing act. The release time not only affects how each note sustains and trails off, but also affects the attack of the next note you play. If the release time from one note crossing the threshold has not completely passed by the time you play the next note, then the compressor will still be reducing your signal level overall when you hit that next note. This can be useful if you want consistent smoothness and your playing is steady with no long rests; inconsistent playing will result in inconsistent signal levels and weird peaks after a long rest. If you want the comp to react only to each note, you have to choose a very short release time; but this can result in a choppy or unnatural sound, with undesirable artifacts known as "pumping and breathing". So the release time is the parameter that will require the most experimentation to get decent results. As with the ratio, sometimes the only "control" over these parameters is to buy a pedal that is preset with attack/release times that just happen to meet your needs. Also note that some comps will distort bass signals if the attack or release times are too short.
Some comps will refer to "hard knee" or "soft knee". A hard knee means the comp will apply 100% of the ratio you set immediately when any of your signal crosses the threshold. A soft knee means a signal that crosses the threshold by only a little bit will only be compressed by a low ratio; and the higher the signal crosses past the threshold, the higher the ratio that will be applied. With a soft knee, the ratio number you choose will be the maximum ratio applied to only the strongest signals crossing the threshold. A soft knee is generally considered to be a more "natural" sound, more like the response of a tube amp for example, but a hard knee is often necessary for corrective compression like peak limiting.
The reason so many pedals only have two knobs, "compress" and "level", is because this keeps the cost down for both manufacturers and consumers. Fewer parts, simpler circuit, smaller box. Also it makes the pedal seem easier to use. However, two-knob control is a problematic compromise because it seriously limits your ability to dial the compressor in to work well for you. As with any circumstance with a lot of compromises, you basically have to suck it up and live with those compromises, or change your circumstances. If you are stuck using a two-knob compressor and you don't get the results you want, the best thing you can do is adjust the level of the signal you feed it. That can really make a huge difference in results, turning a cruddy noisemaker into a useful tool. If cutting or boosting your levels into the comp still doesn't get you what you hoped, then your best bet may be to look for a different unit; at that point you should be able to describe what exactly was not working for you (e.g. not enough peak limiting, mushy note attack, etc.) and ask around for a comp that will work better for you.
Another thing to try: remove the compressor from your chain! Listen to your raw signal for a while and maybe you'll find you didn't want compression after all, or maybe you'll find it helps you articulate exactly what you were hoping the compressor would do for you. This will help others make useful recommendations.