Infrared or IR Spectroscopy is a technique used to characterize covalent bonds molecules with certain types of covalent. The bonds can absorb IR radiation, causing the bonds to vibrate and the IR spectrophotometer can measure which frequencies are absorbed by the molecules. Further clarification, when the radiant energy matches the energy of a specific molecular vibration, absorption occurs. This is generally represented with a spectrum of percent IR radiation transmitted through the sample at a given frequency in wavenumbers. Therefore, the absorbed frequencies are characteristics of the molecular structure.
The peaks are inverted as they represent a decrease in transmitted light. At that frequency, the absorbed frequencies depend on the identity and electronic environment of the bonds. Zero transmittance corresponds to 100% absorption of light at that wavelength and 100% transmission at a wavelength refers to zero absorption at that particular wavelength.
However, each type of bond will absorb IR radiation within a specific frequency range and will have a common peak shape and absorption strength. Therefore this can be used for the identification of an unknown compound from the IR spectrum.
We can assume the covalent bond between two atoms as a spring, connecting two masses, m1 and m2. This spring has its own resonance frequency, which in this case is the frequency of light corresponding to the energy needed to excite an oscillation in the bond at that same frequency. The resonance frequency of a bond depends on the bond strength and length. The resonance frequency also depends on the vibrational mode which is the oscillation pattern of the atoms within a molecule.
The most common vibrational modes observed by IR Spectroscopy are stretching and bending. The linear molecules have (3N-5) vibrational modes where N is the number of atoms and non-linear molecules have (3N-6) vibrational modes.
IR spectrophotometry is primarily performed by shining a broad spectrum, light source through an interferometer at any given time onto the sample and the detector measures the light intensities.
The sample can be gaseous, liquid, or solid, depending on the construction of the instrument for a standard detector. The liquids are placed in demountable cells and sealed cells with Teflon windows. The other widely used techniques for solid sample are directly placing the solid sample (better to use the powder form) or some specific analysis can be done by pressing an alkali halide pellet, mostly a KBr pellet.

The image of FTIR spectrometer was taken from www.thermofisher.com