The main function of resistors in acircuit is to control the flow of current to other components. Take an LED (light) for example. If too much current flows through an LED it is destroyed. So a resistor is used to limit the current.
The name itself mention it's function. Resistor is used to resistance the flow of current. When resistor is placed in a circuit, the current flow decreases when current passes through the resistor. The part of current energy dissipate in the form of heat in resistor, thus decrease the total current. Different values of resistors are available according to the amount of current required.