The other thing that can be difficult about gauge is how to make the swatch. Until you have a real feel for how your knitting or crocheting is, it's important to make a nice, big gauge swatch. Often people work more loosely or tightly at the very beginning of a project than they do further in, sort of like how hand writing becomes a little sloppy after the first page or so. If your gauge swatch is of your starting gauge, it may not give any good information about how your project is going to work.
If your project is going to be worked in the round, make your gauge swatch in the round; and if it is going to be made of flat pieces, make the gauge swatch in flat pieces. In knitting, most people purl at a different gauge than they knit, and working in the round or flat will usually determine how frequently you do each. Some people have such different gauges in knitting than in purling that they use different needle sizes to make their knitting look even. In crochet, all the stitches lean in one direction, so working in rows corrects for that slant. Working in rounds, however, makes all the stitches face the same direction, not only does this give the stitch a different look, but it reinforces the slant of the stitches. While this may not seem relevant to gauge, it does change the drape of the fabric, which is the point of finding a good gauge.
Finally, new needle workers are often very careful about following patterns to the letter, not realizing that every person handles the yarn and needles a little differently. The gauge and needle size recommended in any given pattern are suggestions. If the gauge cannot be achieved by using the suggested needle size, do not choose the recommended needle size over the prescribed gauge. Play around with needle size until you get the right gauge. It might not be exactly what the pattern says, but it will make the pattern work.
In the end, the purpose of measuring gauge and making a gauge swatch is to make the best possible fabric in your project and to make sure that project fits whatever dimensions it needs to. And how you knit or crochet is just as unique as your fingerprint. Happy knitting!