Euclid's theorem for calculating GCD of two numbers.
In a nutshell:
Given x and y, find out z such that it's the biggest number that divides both x and y completely.
Very basic - via subtraction
Given: two numbers x, y
To calculate: maximum such z that it divides both x and y
1. Take the bigger number and subtract smaller from it as many times as possible, keeping the result positive.
2. Repeat until both are not equal.
You can do it better using remainders instead of subtraction.