For both 3 & 9, you have to add up the sum of their digits and if the sum is divisible by 9 or 3 (depending on which you are dividing by), then it is divisible by that number.
For example, 165 is divisible by 3 because 1 + 6 + 5 = 12 and 12 is divisible by 3
54 is divisible by 9 because 5 + 4 is divisible by 9
You can tell if a number is divisible by 6 if it is divisible by 3 & 2. Essentially, if it is even and the sum of its digits are divisible by 3, it is divisible by 6.
For example, 102 is divisible by 6 because it is even and 1 + 0 + 2 = 3, which is divisible by 3.