How do the superconducting electromagnets work in the LHC?
Electromagnet
An electromagnet is a type of magnet which the magnetic field is produced by the flow of electric current.
Superconducting magnet
A superconducting magnet is an electromagnet that is built using coils of superconducting wire. They must be cooled to cryogenic temperatures during operation. The advantage of a superconducting magnet is that it produces a much stronger magnetic field than regular wire coil magnets.
Dipole magnets
A dipole magnet, in particle accelerators, is a magnet condtructed to create homogeneous magnetic field over some distance. Particle motion in that field will be circular in a plane perpendicular to the field and collinear to the direction of a particle motion and free in the direction orthogonal to it.Thus, a particle injected into a dipole magnet will travel on a circular or helical trajectory. In particle accelerators, dipole magnets are used in bending particles to designed trajectory (or 'orbit').

Picture above: graph illustrating a particle with positive charge travel through a circular path in a magnetic field according to Right Hand Rule: the centripital force exerted by the field and inertia of the mass of the particle.
Quadrupole magnets
Quadrupole magnets consist of groups of 4 magnets laid out so that in the multiple expansion of the magnetic field the dipole terms cancel and where the lowest significant terms in the field equations are quadrupole. Quadrupole magnets are useful as they create a magnetic field whose magnitude grows rapidly with the radial distance from its longitudinal axis. This is used in particle beam focusing.
Picture left: graph of a set of quadrupole magnets
LHC: Accelerating——Bending——Focusing
LHC Simulation Game:Click to play a game simulating the process of accelerating, bending, and focusing the protons at the LHC.