When you finish the pattern, are you left with a small number of stitches??? If so, what you want to do is cut your working yarn leaving a good length tail, and with a tapestry needle, thread the working yarn through the stitches one by one that are remaining on your knitting needle. You can then pull out your knitting needle and tighten those last few stitches by pulling on the yarn end.
Another question....was your hat knit in one piece in the round, or was it knit flat?? If it was knit flat, you now need to seam the hat closed and you can do so using the SAME yarn that you just threaded through the top stitches so make sure you leave it long enough for that as well.