The first hat I knit was on two straight needles.
It's fairly simple, but I suggest since you are a beginner that you find a pattern (try http://www.knittingpatterncentral.com/index.php
) to help you through your first time.
Basically, you knit the hat straight back and forth on the needles starting at the bottom cuff of the hat, make decreases to shape the crown, and when you're done you have a few stitches left that you run the yarn through and pull tight. Then you sew up the side seam -- an excellent way to learn mattress stitch, which you can find out about at this site.