What does a resistor do in an electrical circuit?
The resistance of a conductor limits the amount of current that can flow in the conductor for a given potential difference.
I have been told to think of water flowing in a pipe and which has a
narrow part like this. Now in a wire this would imply constant current, so i am confused here. Wait, isn't current constant in series, so is this true ?
Yes the current is constant in resistors in series. If it were not, charge would build up.
You need to start with a basic definition of current, such as:
Electric current $i(t)$ through a surface is defined as the rate of charge transport through that surface, or
$$i(t)=\frac{dq(t)}{dt}$$
Where $q(t) denotes instantaneous charge.
Since the two sections of pipe, analogous to two resistors, are in "series", the rate of water flow across the wider section must equal that across the narrower section, lest water (analogous to charge) builds up somewhere.
Now, (the) no of electrons is more in larger cross-section than smaller
cross-section
The number of electrons that cross the surface is greater in the larger cross section, but their drift velocity is lower, so that the rate of transport of electrons (current) through both surfaces is the same. For a good microscopic view of electric current, see: http://hyperphysics.phy-astr.gsu.edu/hbase/electric/miccur.html
...this means more charge in larger than smaller and more charge means
more potential, so is this the reason why we say resistor changes the
voltage of circuit
I find this a bit confusing. But start with a basic definition of the potential difference ($V$) between two points:
The potential difference $V$ between two points is the work per unit charge required to move the charge between the points.
More work is required per unit charge to move the charge through the same length of the higher resistance resistor (narrow "pipe") than to move the charge through the same length of the lower resistance resistor (wider "pipe"). So the voltage drop per unit length is higher for the narrow section than the wide section.
The water analogy is the pressure difference per unit length of the narrow section of pipe is greater than the pressure difference per unit length of the wider section of pipe. More work per unit mass of water is needed to push the water through a given length of the narrow pipe than for the same length of the wider pipe.
Hope this helps.