Dig a hole 30 inches deep for the gate post, which will support the hinges. Set the post in the hole and fill the hole with wet concrete to within 3 inches of the surface. Make sure the post is vertical by comparing it to a plumb bob or carpenter's level and let the concrete dry. Fill in the top of the hole with dirt.
Slip two female hinges on the gate frame, one within 6 inches of the top and one within 6 inches of the bottom. The female hinges have a round socket for a pin to slip into, and the male hinges have the corresponding pin. Most gates are symmetrical so you can put the hinges on either side, but to double-check, set the gate oriented the way you want it beside the post and put the hinges on the side near the post. Bolt the hinges on, screwing the nut until the hinge clamps are tight against the frame. Put the nut on the inside of the fence so the neater bolt head shows on the outside.
Set the gate in position beside the post with the bottom of the gate resting on the ground. Draw a pencil mark on the post, level with the bottom of the lower hinge. Set the gate aside. Measure up 2 inches from the mark or whatever clearance you want under your gate and place a new mark on the post to show the location of the hinge. When figuring clearance, allow enough room over the full distance the gate will swing if the ground slopes upward.
Slip the male hinge on the post and bolt it in place with the pin facing upward and the bottom of the pin level with the mark. Tighten the bolt to clamp the hinge on securely.
Put the gate in position again and slip the lower female gate hinge down over the pin. Prop up the far corner of the gate so it rests approximately level. Place the upper male hinge on the post with the pin facing downward and slide it so the pin slips down into the upper female hinge. Bolt the upper male hinge tightly to the post.
Remove the prop and test the gate to make sure it swings freely. Loosen the hinge bolts and adjust the position of the hinges as needed.
Slip the gate latch onto the other side of the gate frame and bolt it in place at a convenient height. Dig a hole and install the latch post the same way you installed the gate post. Space the latch post so the latch rests around the latch post when it is down, and so the latch post swings up and down freely.