30=6×5; n=6p where p is an integer (whole number) which is not a multiple of 5.
When p=1, n=6 so the HCF of 30 and 6 is 6 because it divides into both numbers and is the highest factor to do so.
You could also have 30 and 12 (p=2), 30 and 18 (p=3), 30 and 24 (p=4), but not 30 and 30 (p=5), or 30 and 60 (p=10), because 5 and 10 are multiples of 5. Another example: 30 and 102 have HCF=6.