The Hardy-Weinberg equation is: p2+2pq+q2=1
It is important to remember that p+q also equals 1.
p2 is the frequency of the homozygous dominant genotype, and q2 the recessive. 2pq is the frequency of the heterozygous genotype.
p and q are the allele frequencies of the dominant and recessive allele respectively.
Exam questions will give you one frequency (either an allele or geno/phenotype frequency) and using this you will have to work out the other values that go into the equation in order to provide the answer that the particular question is looking for.