There are many ways. Here's how I do it:
Take whatever numbers or variables you have and write them out as factors. If you have 24x^2y and 30xy^2 you get this:
24x^2y = 2 * 2 * 2 * 3 * x * x * y
30xy^2 = 2 * 3 * 5 * x * y * y
The greatest common factor (GCF) is the product of the factors that appear in both of those.
Circle the numbers that appear in both lists like this:
We only circle 2 once because, while it appears three times in 24x^y, it only appears once in 30xy^2.
Pick one row of circled things and multiply them together like this:
2 * 3 * x * y = 6xy
Whatever you end up with (6xy in this example) is the GCF.