(1) While tracing a loop, if we traverse a resistor along the direction of conventional current, the potential difference across the resistor is considered negative. If we traverse the resistor opposite to the direction of conventional current, the potential difference across the resistor is considered positive.
(2) While tracing a loop within the source, if we travel from the negative terminal of the source (cell) to the positive terminal of the source (cell), the emf of the source (cell) is considered positive.
On the contrary, if we travel from the positive terminal of the source (cell) to the negative terminal of the source (cell), the emf of the source (cell) is considered negative.

Electric network
Consider the electrical network shown in above figure.
Tracing loop ABFGA in the clockwise direction, we get,
– I1R1 – I3R5 – I1R3 + E1 = 0
∴ E1 = I1R1 + I3R5 + I1R3
Tracing loop BFDCB in the anticlockwise direction, we get
– I3R5 – I2R4 + E2 – I2R2 = 0
∴ E2 = I2R2 + I3R5 + I2R4
[Notes : (1) We may as well consider loop ABCDFGA and write the corresponding equation. (2) As the emf of a cell is the energy provided by the cell per unit charge in circulating the charge and the potential difference across a resistance is the work done per unit charge, it follows that this law (voltage law /loop law) is based on the conservation of energy.]