As I've stated in my measurement guide, this is a vital part of making your garment. Knitting instructions always give a tension guide but sometimes we choose to ignore this in our keeness to start a new project. This can be a fatal error and is really worth the time spent on it.
Work a sample using the yarn and recommended needle size for the project. If the instructions specify 22 stitches and 30 rows to 10cm/4" I would cast on 30 or so stitches and work 36 rows. The instructions should say if the tension guide is worked in a specific pattern otherwise presume its the main pattern used in the instructions. Lay the swatch flat without stretching it. Count 4 stitches in from the edge and place a pin between this and the next stitch. Count across the row the number of stitches stated in the tension i.e 22 and place another pin there. Be careful with this - even one stitch over 10cm multiplies to a big size difference over the whole garment ad the results could be very disappointing. Now measure the distance between the pins.If your tension is correct it will measure exactly 10cm/4". If the distance is less, your work is too tight - try again with larger size needles. If it is more, your work is too loose - try again with smaller size needles.
The horizontal tension is the most important to get right if you can't match both stitches and rows by altering needle size, as vertical tension can be usually be corrected by adding or subtracting rows.Some knitters find it easier to count the 'bumps' on the reverse of a stocking stitch/ stockinette tension swatch rather than the smooth side.
If you suspect the yarn you are using may shrink, it is important to wash your swatch and repeat the measuring.