With equal denominators
The sum of two fractions with equal denominators is a new fraction with the same denominator and the numerator with the sum of the numerators.
To subtract fractions we proceed in the same way: keep the same denominator and subtract the numerators.
For example, we want to sum $$\dfrac{1}{5}$$ and $$\dfrac{3}{5}$$. We draw both fractions as partitions of rectangles. The fraction $$\dfrac{1}{5}$$ is:
And the fraction $$\dfrac{3}{5}$$ is:
We want to do the sum, ie, to have at the same time the painted rectangles about the first fraction and then about the second one.
The result is $$4$$ painted rectangles:
Thus, the sum of $$\dfrac{1}{5}$$ and $$\dfrac{3}{5}$$ is $$\dfrac{4}{5}$$. $$$\dfrac{1}{5}+\dfrac{3}{5}=\dfrac{4}{5}$$$
To subtract fractions we proceed in the same way:
To subtract $$\dfrac{5}{7}$$ to the fraction $$\dfrac{9}{7}$$, we start drawing the rectangles. The fraction $$\dfrac{9}{7}$$ is:
And the fraction $$\dfrac{5}{7}$$ is:
So if we subtract the five painted rectangles of the second fraction to the first one, the result is:
(We have painted the red ones with lilac and we have removed the blue ones)
So: $$$\dfrac{9}{7}\dfrac{5}{7}=\dfrac{4}{7}$$$
This simple operation can be formulated as follows: $$$\dfrac{a}{c}\pm\dfrac{b}{c}=\dfrac{a\pm b}{c}$$$
With different denominators
Now, we want to do the following sum: $$\dfrac{3}{12}+\dfrac{1}{6}$$.
The denominators are different, $$12$$ and $$6$$, so we can't use what we have explained until now. Nevertheless, we can find an equivalent fraction for each one, in order to get the same denominator.
We can do it, for example, multiplying the numerator and denominator of the first fraction by the denominator of the second one, and then multiplying the numerator and denominator of the second one by the denominator of the first one.
Then we will get two equivalent fractions with equal denominators (the multiplication of the denominators), and we will be able to sum or subtract them.
To sum $$\dfrac{3}{12}$$ and $$\dfrac{1}{6}$$ we do: $$$\dfrac{3}{12}=\dfrac{3\cdot6}{12\cdot6}=\dfrac{18}{72}$$$ and
$$$\dfrac{1}{6}=\dfrac{1\cdot12}{6\cdot12}=\dfrac{12}{72}$$$
And now we can sum: $$$\dfrac{3}{12}+\dfrac{1}{6}=\dfrac{18}{72}+\dfrac{12}{72}=\dfrac{18+12}{72}=\dfrac{30}{72}$$$ Finally, we must simplify the fraction: $$$\left.\begin{array}{l} 30=2\cdot3\cdot5 \\ 72=2^3\cdot 3^2 \end{array} \right\} \Rightarrow g.c.d(30,72)=2\cdot3=6$$$
So $$$\dfrac{30}{72}=\dfrac{30:6}{72:6}=\dfrac{5}{12}$$$
The result is: $$$\dfrac{3}{12}+\dfrac{1}{6}=\dfrac{5}{12}$$$
This procedure can be summarized by the formula: $$$\dfrac{a}{b}\pm\dfrac{c}{d}=\dfrac{(a\times d)\pm(b\times c)}{b\times d}$$$
Using the same example, $$$\dfrac{3}{12}+\dfrac{1}{6}=\dfrac{(3\times 6)+(12\times 1)}{12\times 6}=\dfrac{18\times 12}{72}=\dfrac{30}{72}$$$
And the last step is simplify the fraction.
Nevertheless, using this method we must carry on with high numbers ($$30$$ or $$72$$) which then needs a simplification.
To achieve the least common denominator possible we must calculate the least common multiple ($$l.c.m$$) of the denominators.
Using our example, we calculate the $$l.c.m.$$ of $$12$$ and $$6$$: $$$\left.\begin{array}{l} 6=2\cdot3 \\ 12=2^2\cdot 3 \end{array} \right\} \Rightarrow l.c.m(6,12)=2^2\cdot3=12$$$ so we need equivalent fractions with denominators $$12$$. For this one $$\dfrac{3}{12}$$, the result is ovbiuosly the very same fraction, but let's see a method to find it in general.
We have to calculate for each fraction the number $$m$$
$$$m=\dfrac{\mbox{lcm denominators}}{\mbox{denominator of the fraction}}$$$
For the fraction $$\dfrac{1}{6}$$, the number $$m$$ is: $$$m=\dfrac{lcm(6,12)}{6}=\dfrac{12}{6}=2$$$ and for the other fraction $$\dfrac{3}{12}$$: $$$m=\dfrac{lcm(6,12)}{12}=\dfrac{12}{12}=1$$$
So now, the last step is multiply the numerator and denominator of each fraction by its number $$m$$ and then sum the numerators. Finally, we must simplify the fraction, if it's possible.
Using the last example: $$$\dfrac{1}{6}=\dfrac{1\cdot 2}{6\cdot 2}=\dfrac{2}{12}$$$ and $$$\dfrac{3}{12}=\dfrac{3\cdot 1}{12\cdot 1}=\dfrac{3}{12}$$$ The sum is: $$$\dfrac{1}{6}+\dfrac{3}{12}=\dfrac{2}{12}+\dfrac{3}{12}=\dfrac{2+3}{12}=\dfrac{5}{12}$$$ And this result is already simplified.
Summarizing, to sum or subtract two fractions or more with different denominators we must do:
 Simplify the fractions, if it's possible.
 Calculate the least common multiple ($$l.c.m$$) of the denominators.

Calculate the number $$m$$ for each fraction. $$$m=\dfrac{\mbox{lcm denominators}}{\mbox{denominator of the fraction}}$$$
 Calculate the equivalent fractions, multiplying numerator and denominator by $$m$$.
 Sum and subtract the fractions with the same denominator.
 Simplify the fraction, if it's possible.