Compressor is a device to level out the dynamics of a signal. It minimises the difference between the peaks and troughs of the signal, bringing the loud parts down and the softer parts up.
In the studio, a compressor is often used to smoothen a track. For guitarists, we often use a compressor pedal to add attack and sustain. There are many different type of compressors and they all have their own characters, i.e. Optical, FET (Field Effect Transistor), VCA (Voltage Controlled Amplifier) and OTA (Operational Transconductance Amplifier). Do your research and try them out to see which suits your style best.